Analytics
5.2K members online now
5.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

'Invalid tracking Id' message with event tracking in ga.js

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Struggling to make this work; implementing this code:

 

<p><a class="png icon info" href="/userfiles/16-17 OPEN SPACE Application Form.doc" target="_blank" onclick="var that=this;_gaq.push(['_trackEvent', 'Open Space', 'Download Form']);setTimeout(function(){location.href=that.href;},400);return false;">Download Open Space application form</a></p>

 

But analytics debugger returns the message 'Invalid tracking code. Aborting hit' when the link is fired.

 

You can see the live code here:

 

http://www.aldeburgh.co.uk/residencies/open_space

 

We're running ga.js version 5.6.7d

 

Any thoughts would be much appreciated. 

 

Re: 'Invalid tracking Id' message with event tracking in ga.js

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
Typically I just resolved this after finally asking for help!

The answer was, we are still using the non-asynchronous tracking code - so I needed to use this syntax to send the event:

onclick="var that=this;pageTracker._trackEvent('Open Space', 'Download Form');setTimeout(function(){location.href=that.href;},400);return false;"