A while ago I noticed the sudden demise of the goal tracking across several websites I manage in Google analytics – one day the goals just died! Fortunately in my analytics account I had made a note (using the lovely annotations you can add to your timeline) that this occurred at the exact same time I had updated the analytics code on those sites. Coincidence, no!
In order to track the submission of forms and clicks on ‘mailto’ links across several websites I had setup some goals in Google Analytics.
For a mailto links I used the following:
However since Google updated to the latest iteration of it’s asynchronous tracking code the syntax for tracking page views has changed.
If you have updated to the latest version of the Google analytics code you will also need to update your pageTracker code. For forms I now use:
And for mailto links:
… and once again your goals will be tracked and reported in Google analytics. I’m sure this was probably mentioned somewhere in the literature about migrating to the new tracking code, but really, who reads all that!
If you’re unsure which version of Google’s tracking code you are using you can read more here.
Categorised in: Web Development
This post was written by WillyNilly