Reputation: 99
I've been asked to migrate analytics at my company to GA4, but I've got no experience with analytics.
I've created a new property on the google analytics page and added the below code into the website, just beneath the head.
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXX');
</script>
I've got a couple of questions:
ga('send', {xxxx})
Any help is massively appreciated.
Thanks
Edit: I have already connected the original UA to GA4, and both analytics code are currently sitting in the website, and I can see data tracking as users click/navigate through the website. I just don't know if this will break on July 1st when UA ends.
Upvotes: 2
Views: 1337
Reputation: 8126
If you connected the original UA to GA4, that's it. You don't need the parallel GA4 tracking, and you've done your MVP migration. It will live after UA discontinuation.
The next step, if needed, would be implementing parallel GA4 tracking into a different property, then gradually moving your data stakeholders to GA4, explaining them all the differences in metrics and dimensions. Now one may ask why bother with gtag if analytics.js can do the same. Kinda yes and no. Google allows analytics.js tracking format only to then cast it into ga4 data format. There's no expectation that analytics.js would be updated or maintained as a library after the discontinuation. It will continue to work, it only is expected to get quite limited with time.
The next step would be getting rid of your inline direct analytics function calls moving all this logic to GTM where it's supposed to live.
Upvotes: 3