So using some information gathered around the web, I put together this simple script to push data into Google Analytics. This will register each script run as a pageview. If you want to keep track of account ids where the script is running, you will need to add AdWordsApp.currentAccount().getCustomerId() somewhere in the CAMPAIGN or PAGE values. Once you have this code in your script, just make a call to beacon(); at the beginning of your code. And since many tracking systems mimic the Google Analytics tracking format, I'm sure this can be easily adapted to other systems.
Thanks,
Russ
/******************************** * Track Script Runs in Google Analytics * Created By: Russ Savage * FreeAdWordsScripts.com ********************************/ function beacon() { var TAG_ID = 'UA-XXXXXXXX-X'; var CAMPAIGN_SOURCE = 'adwords'; var CAMPAIGN_MEDIUM = 'scripts'; var CAMPAIGN_NAME = 'Your Script Name And Version'; var HOSTNAME = 'www.freeadwordsscripts.com'; var PAGE = '/Some/Virtual/Page/Similar/To/Campaign/Name/Probably'; var DOMAIN_LINK = 'http://'+HOSTNAME+PAGE; //Pulled from: http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}); var url = 'http://www.google-analytics.com/collect?'; var payload = { 'v':1,'tid':TAG_ID,'cid':uuid, 't':'pageview','cs':CAMPAIGN_SOURCE,'cm':CAMPAIGN_MEDIUM,'cn':CAMPAIGN_NAME, 'dl':DOMAIN_LINK }; var qs = ''; for(var key in payload) { qs += key + '=' + encodeURIComponent(payload[key]) + '&'; } url += qs.substring(0,qs.length-1); UrlFetchApp.fetch(url); }
Amazing information,thank you for your ideas.after along time i have studied an interesting information's.we need more updates in your
ReplyDeleteblog.
Digital Marketing Course in Chennai
Digital Marketing Course in Velachery
JAVA Training in Chennai
Python Training in Chennai
IOS Training in Chennai
Selenium Training in Chennai
Big data training in chennai
digital marketing course in chennai
digital marketing training in velachery
Looking for latest update on TNPSC exams? Kalviseithi - #1 educational portal offer latest news about TN state government jobs, educational news and much more information.
ReplyDeletePositive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. ( Locateanumber.com | www.locateanumber.com | http://locateanumber.com | https://locateanumber.com )
ReplyDeletePositive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Locateanumber.com
ReplyDeletenice explanation, thanks for sharing, it is very informative
ReplyDeletetop 100 machine learning interview questions
top 100 machine learning interview questions and answers
Machine learning interview questions
Machine learning job interview questions
Machine learning interview questions techtutorial
Machine learning job interview questions and answers
Machine learning interview questions and answers online
Machine learning interview questions and answers for freshers
interview question for machine learning
machine learning interview questions and answers
Do you want to know how to use Website Blockers for Safety? On https://celltrackingapps.com/website-blocker/ you can read more about it
ReplyDeleteYou are so thrilling! I do no longer take into account I've certainly study through some thing like that before. So splendid to discover any other character with some precise mind in this difficulty click. Seriously.. Many thanks for beginning this up. This internet site is some component this is required on the net, a person with a piece of originality!
ReplyDeleteWith a parental control like mSpy, I can track even Skype on my kid's phone. As a parent, I find it extremely important not to let my son to be involved in any kind of online scam. So, I do my best!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHire a hacker cheap
ReplyDeletegenuine hacker for hire
How to change your grades
rent-a-hacker
these techniques derive results that can perform much better without the need of programming rules. data science course in hyderabad
ReplyDeleteThe way people find information now is quite a bit different than 10 years ago. This may be obvious to most people but many businesses have not responded to this challenge. Your website is your main marketing tool now and your web design is critical to successful marketing. Jake Hackett
ReplyDeletespy on spouse cell phone for free
ReplyDeletehire a hacker
Hacking phone
ReplyDeletechange your grades
Eu estarei interessado em tópicos mais semelhantes. vejo que você tem tópicos realmente muito úteis, estarei sempre checando seu blog, obrigado bruno espiao
ReplyDeletehttps://en.vpnwelt.com/
ReplyDelete