If you're moving from hard-coded @googleanalytics code to Google Tag Manager, here are 3 steps that you need to make to ensure no data is lost in the transition.

A 🧡
Step 1:

Create a Google Tag Manager Container and install it on your website.
Step 2: Use @screamingfrog to confirm that all the pages have the GTM snippet code.

πŸ‘‰ Go to Configuration > Custom > Search (screenshot 1)
πŸ‘‰ Configure the rule to find the GTM code you need in the page HTML (screenshot 2)
Now have both codes on the website: Google Tag Manager and Google Analytics.

The GTM should be empty at this point so that your sessions are not double-counted.
The next step should be to remove the GA code. But what happens if you remove it without having a working GA tag in GTM? You'll lose data.

But also, what happens if you for some time will have both hard-coded GA and a GA tag in the Tag Manager? You'll cause data discrepancy
This is a very possible situation, especially if the whole process involves the coordination of multiple departments.

So I'm adding a new step here to mitigate risks: a GA tag in Google Tag Manager that will fire only if there's NO hard-coded GA code in the page HTML -> Step 3
Step 3: Create a variable in GTM that will check if the Google Analytics code is found in the page HTML.

- If it's found -> not fire the GA tag
- if it's not found -> fire the GA tag

+ Debug

I wrote how to do it a while ago, find all the code here πŸ‘‡
marketingsyrup.com/gtm-variable-c…
Step 4: Remove the GA code from the website.

You can also use Screaming Frog custom search here but configure the rule so that it says 'does not contain' for the GA code.

This way you can check if the GA code has been removed from all pages.
Step 5: Test and debug everything again.

If all things work as expected, you can remove the temporary tag created in Step 3.
That's it.

Test. Debug. Mitigate risks.

/end of 🧡
P.S. I initially thought I'll put it in 3 steps, hence the 1st tweet haha. But then decided to be more descriptive.

So read '5' not '3' in the initial tweet πŸ˜‹

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Kristina Azarenko πŸ”₯

Kristina Azarenko πŸ”₯ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @azarchick

15 Jun
Technical SEO alert: you need to know this!

#Google ranks pages, not websites. In order to get your page indexed, it should have a separate URL that Google can discover and follow. Here are the main tips to make this happen:

1/5
- Always use an HREF attribute so that Google can easily discover and follow a link

- Ideally, use HTML links. JS links are ok as long as they use an HREF attribute

2/5
- Google won’t follow and index URLs with fragments (containing #, e.g. store.com/catalog#gifts) as they are not created to lead to a new document/page. So if you want a fragmented URL to be indexed as a separate page, don’t use fragments, e.g. store.com/catalog/gifts

3/5
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(