2

I'm currently using ga.js and I want to upgrade to the universal analytics.

Do I need to restate all my old ga calls to do that or is it backwards compatible. The google documentation seems a big vague on this topic.

example of a ga call:

_gaq.push(['_setAllowAnchor', true]);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);

I want to know how much re-work I have to do, or if I can just update standard js snippet.

1

You will have to use the new syntax with Universal Analytics (if applicable):

_gaq.push(['_setAllowAnchor', true]); // ga('create', 'UA-XXX-Y', {'allowAnchor': true});
_gaq.push(['_trackPageview']); // ga('send', 'pageview');
_gaq.push(['_trackPageLoadTime']); // This has been deprecated and is a default feature in UA

More info about page load timing can be found here: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.