Skip to content

Instantly share code, notes, and snippets.

@edtoken
Created April 7, 2014 08:43
Show Gist options
  • Save edtoken/10016800 to your computer and use it in GitHub Desktop.
Save edtoken/10016800 to your computer and use it in GitHub Desktop.
/**
* trigger to send yandex tag
*/
window.sendyatag(this, data);
window.sendyatag = function(obj, data){
var tag;
tag = '';
var d = obj.data;
d = d.split('&');
for(var i=0; i<d.length;i++){
values = d[i].split('=');
if(values[0] !== 'yandextag') continue;
tag = values[1];
}
if(tag !== ''){
tag = decodeURIComponent(tag);
var sendtag = yaCounter17593912.reachGoal(tag);
// console.log('send yandex tag', tag, sendtag);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment