AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

1.7K members online now
1.7K 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

analytics.js and ga.js on same website but different pages

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm looking to upgrade our website to universal analytics (analytics.js). We have a number of pages which fire events and ecommerce data so this might take some time and would like to avoid big bang approach.




  1. Is it possible to upgrade some pages to analytics.js but leave other pages on ga.js for the time being? I do not plan on ever having both on the same page.
  2. Are there any implications on this (other than ensuring that each page fires the appropriate code for events and ecommerce data)?
  3. Will pages still be tracked in same session as people browse around the site and therefore switch back and forth between both?
  4. Anything else to be aware of when doing this?

I see from this link:

that this is possible due to mention of "such as with larger websites that have not completely retagged with analytics.js and have both tracking codes present for some period of time."

but confused exactly what it means when it talks about cookie imports. If I'm using standard cookie names and have not customised them at all then will this just work without any extra effort other than replacing the tag with the analytics.js tag and updating any events and ecommerce code to the new format at the same time? Especially when going back from analytics.js to ga.js on some pages.




1 Expert replyverified_user

Re: analytics.js and ga.js on same website but different pages

Top Contributor
# 2
Top Contributor
Hi Barry,

Although it might be technically feasible to interchange old and new Analytics-code versions on a page-to-page level, things surely get more complicated with session metrics. So, I wouldn't recommend that mixture on a live website. I would try instead to do all testing on a development server (and by the way possibly switching to Google Tag Manager if you have to re-tag everything anyway).