Analytics
2.2K members online now
2.2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Problem with custom Tracking Script

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there,

 

I've got the following custom tracking snippet on a customer's website.

 

<script type="text/javascript">
if (typeof(tw_gat) == 'object') {
	tw_gat.debug(0)
		.setAccount('UA-xxx-1')
		.setDomainName('none')
		.setCrossDomains([])
		.enableAdvertising(0)
		.anonymizeIP(1)
		.trackClientInfo(1)
		.trackFlashVersion(0)
		.trackPageTitle(1)
		.trackExternals(0,'',[])
		.trackEmails(0,'',Array)
		.trackDownloads(1,'Download','{pathname}',{"\/":["doc","docx","pdf","xls","ppt","zip","gz","bz2","rar","txt","vsd","vxd","js","css","exe","wma","mov","avi","wmv","mp3","mp4"]})
		.addDirectKeywords([])
		.addDirectReferrers([])
		.addSearchEngines([])
		.registerCustomVariables([])
		.trackPageview("/de/");
	(function(){ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src='//www.google-analytics.com/ga.js'; ga.onload = function() { tw_gat.installTrackingHandlers(2); }; ga.onreadystatechange = function() { if (this.readyState in {'loaded': 1, 'complete': 1}) tw_gat.installTrackingHandlers(2); }; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();
}
</script>

The customer told me there is no data transferred to Google Analytics, i.e. the dashboard does not show new data since a specific date.

 

Is there any problem with this custom code?

 

Thx for your help, Björn

1 Expert replyverified_user

Re: Problem with custom Tracking Script

Top Contributor
# 2
Top Contributor
Hi,

Can you show a page where this code is implemented? It is not working as is in your post.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital