0

All the while, I've been using the old classic ga.js (e.g. _gaq.push()) to generate monthly traffic report for my clients. Now, I decided to migrate over to the latest gtag.js in order to replace my custom variables with the new custom dimensions (or probably custom metrics as well). But one problem here:

  • How do I handle the Month Transition for the accuracy of report data?

When I think of parallel run of old and new tracking codes (at least 1 week before the coming month), I found this on Google Analytics Help:

You can, for example, install multiple instances of the Universal Analytics tag (analytics.js) on your web pages but only one instance of the Classic Analytics code (ga.js). Multiple instances of ga.js might result in inaccurate data collection, processing, or reporting. You can, however, install one or more instances of analytics.js on web pages that also have a single instance of ga.js.

Therefore, I would like confirm this with some experts here: Is it SAFE to go ahead with one instance of ga.js and one instance of gtag.js on the same page? Note that if I don't implement old and new GA codes at the same time, let's say 1 week before the coming month, my custom variables will lose 1 week data; meanwhile, if I use the new report, my custom dimensions will lose 3 weeks data. Also, I just can't simply implement the new code on May 1, 2019 00:00 AM -- What if my new implementation doesn't work? I need several days to monitor it as well.

So this is important to me. I wonder if anyone of you here has experienced this and can assure me that this is safe to go ahead. Thank you so much!

Antonio Ooi
  • 1,601
  • 1
  • 18
  • 32

1 Answers1

0

IMPORTANT UPDATE, May 3, 2019: After using the below method for parallel-run for 1 week, the old tracking code doesn't seem to continue collecting traffic data even though I never change its configurations whatsoever. Apply it at your own risk.

Ok guys, after my full day experiment, it's confirmed that the classical ga.js (_gaq.push()) and gtag.js can be concurrently run on the same page and same site for the sake of resolving the migration issue as mentioned in my question above. The trick here is: Create a new property with new tracking ID for your new tracking code (gtag.js) with similar view settings and custom reports. Below are the steps:

For the new gtag.js:

  1. Create a new GA property for the same website with new tracking code/ID.
  2. Verify and complete your View Settings for the new property if necessary.
  3. Define your Custom Dimensions accordingly.
  4. Create your custom reports if necessary.
  5. Get your new tracking code under your new Property -> Tracking Info -> Tracking Code.
  6. Paste your new tracking code just right before your old tracking code (preferably in a different <script> tag).
  7. Add your custom dimension code accordingly.

For the old ga.js:

  1. Do nothing and keep it as it is.
  2. After the cut-off date is over, just remove or comment out the old <script> tag of your old GA tracking code.

Open both your old and new GA reports with their respective property view and monitor the traffic result. If still no data on the new report, comment out the <script> tag of your new tracking code and troubleshoot again (or else it may affect even your old tracking code as well), make sure your custom dimension code has no errors, otherwise it should work with different tracking code managing different property ID (no conflict). If you need the same solution, hope this helps!

Antonio Ooi
  • 1,601
  • 1
  • 18
  • 32