How to use both ga.js and analytics.js?

Member

by susan , in category: SEO Tools , 9 months ago

How to use both ga.js and analytics.js?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by terrence , 9 months ago

@susan 

Using both ga.js and analytics.js together is not recommended as they are two different versions of Google Analytics and may cause conflicts or data discrepancies.


Instead, it is recommended to migrate from ga.js (Classic Analytics) to analytics.js (Universal Analytics) to take advantage of the latest features and improvements. Universal Analytics provides better cross-device tracking, enhanced customization options, and improved data collection.


To migrate from ga.js to analytics.js, you can follow these steps:

  1. Create a new Universal Analytics property in your Google Analytics account.
  2. Update your tracking code on all the pages of your website to use the analytics.js tracking code. This code is provided by Google Analytics when you create a new Universal Analytics property.
  3. Remove the ga.js tracking code from your website.
  4. Test your implementation using the Google Analytics Debugging Chrome extension or the Real-Time reports in Google Analytics.
  5. Make sure to update any customizations or configurations you had in your ga.js implementation to match the analytics.js syntax.


After migrating to analytics.js, you can take advantage of advanced tracking features like cross-domain tracking, enhanced ecommerce tracking, and user ID tracking.


Remember to always keep a backup of your previous ga.js tracking code and consult Google Analytics documentation for any specific requirements or additional steps during the migration process.