Technically you are migrating from gtag.js to GTM (GTM is a tag manager, and while it can be used to deploy GA by itself it tracks nothing).

If you want to integrate Google Analytics via GTM then the second snippet in your post is the replacement for the first, not an addition. You need the second snippet, then you configure GTM to deploy Google Analytics to your page. For most use cases you do not even need the noscript tag (unless you specifically configure tags that run in noscript mode).

For you debounce-event you can use a timeout to push an event to the datalayer and then use it to trigger a Google Analytics Event. You can do this either somewhere in your page code, or in a custom HTML tag that is triggered on a Pageview (or DOM ready) event.

setTimeout(dataLayer.push({'event':'deBounce'}),20000);

Then you create a trigger of the "Custom Event" type an in the field "event name" you enter "debounce" (without the quotes). You then use that trigger to fire a Google Analytics tag that is set to event tracking in GTM (you notice already that this is not really simpler than gtag.js, but it allows you to control also non-Google tags so it's probably worth the effort).

The "Event" key is special in the dataLayer object - Google overwrites the native push-method in the datalayer array to listen for object keys called "event". Whenever it hits an "event" key it updates all internal variable from the dataLayer (this adds all newly pushed values) and then allows to fire tag.

Answer from Eike Pierstorff on Stack Overflow
🌐
Seriouslysimplemarketing
seriouslysimplemarketing.com › migrating-google-tag-manager-easy-follow-guide
Migrating to Google Tag Manager: An Easy to Follow Guide — Seriously Simple Marketing
When you’re migrating from Google Analytics to Google Tag Manager, what you’re really doing is moving the control of what and how data is going to report in Google Analytics to Tag Manager.
🌐
Google Support
support.google.com › tagmanager › thread › 5729450
Best Practices for migrating from gtag.js (Global Site Tag) to GTM - Tag Manager Community
Skip to main content · Tag Manager Help · Sign in · Google Help · Help Center · Get started with Tag Manager · Get started with the Google tag · Manage user consent with consent mode · Manage accounts and containers · Concepts and components
🌐
Defence Media
defence-media.com › home › blog › tutorial: migrating from gtag.js to google tag manager (gtm)
Tutorial: Migrating from gtag.js to Google Tag Manager (GTM) - Defence Media
September 17, 2025 - Once tested, publish the container and remove all instances of gtag.js from your site. A: Yes. When migrating to Google Tag Manager, you should remove the existing gtag.js snippet from your site.
Top answer
1 of 2
3

Technically you are migrating from gtag.js to GTM (GTM is a tag manager, and while it can be used to deploy GA by itself it tracks nothing).

If you want to integrate Google Analytics via GTM then the second snippet in your post is the replacement for the first, not an addition. You need the second snippet, then you configure GTM to deploy Google Analytics to your page. For most use cases you do not even need the noscript tag (unless you specifically configure tags that run in noscript mode).

For you debounce-event you can use a timeout to push an event to the datalayer and then use it to trigger a Google Analytics Event. You can do this either somewhere in your page code, or in a custom HTML tag that is triggered on a Pageview (or DOM ready) event.

setTimeout(dataLayer.push({'event':'deBounce'}),20000);

Then you create a trigger of the "Custom Event" type an in the field "event name" you enter "debounce" (without the quotes). You then use that trigger to fire a Google Analytics tag that is set to event tracking in GTM (you notice already that this is not really simpler than gtag.js, but it allows you to control also non-Google tags so it's probably worth the effort).

The "Event" key is special in the dataLayer object - Google overwrites the native push-method in the datalayer array to listen for object keys called "event". Whenever it hits an "event" key it updates all internal variable from the dataLayer (this adds all newly pushed values) and then allows to fire tag.

2 of 2
0

Yes you would need both the script to set up GTM. 1st code preferably in the head section and 2nd code in the body section of your website.The code enables tag manger to fire tags by inserting gtm.js in the page. Once your GTM is set up ,for tracking you can create universal Analytics tag to track your events.Check out the url below for tracking events using GTM.

https://www.gravitatedesign.com/blog/google-tag-manager-analytics-event-tracking-2018/

🌐
Google Support
support.google.com › tagmanager › answer › 7582054
Google Tag Manager vs. gtag.js - Tag Manager Help
Note: The Google tag (gtag.js) can only send data to Google services. If your tagging needs evolve, you can always migrate your tags to Google Tag Manager at a later date.
🌐
ThreeVentures
threeventures.com › solutions to accelerate revenue & optimize profits for marketing, sales, it & customer success › what is google tag manager, how to migrate to it, and best practices
What Is Google Tag Manager, How To Migrate To It, And Best Practices
September 28, 2023 - If you're using ga.js, define _gaq before the GTM Snippet. Make sure you comment out the document.write code from the file s_code.js. Making the migration to GTM is no easy task, but in the long run, it's definitely worth it. Updating tags becomes less of a hassle and can be done in a fraction of the time.
Price   $$$$
Address   950 Reserve Drive #100, 95678, Roseville
🌐
Tactic Lab
tacticlab.com.au › home › knowledge base › how to safely migrate a tag to gtm
How to safely migrate a tag to GTM | Tactic Lab
August 22, 2024 - GA4/Google Ads: googletagmanager.com/gtag/js?id=XXX (where XXX will be your GA4 or Google Ads measurement ID) Meta Pixel: connect.facebook.net/en_US/fbevents.js · LinkedIn Insight Tag: snap.licdn.com/li.lms-analytics/insight.min.js · Microsoft Universal Event Tag: bat.bing.com/bat.js ... To put this together, let’s imagine that we are trying to migrate the Meta Pixel into GTM.
Find elsewhere
🌐
YouTube
youtube.com › watch
Migrating To Google Tag Manager – GTM Tutorial Lesson 4 - YouTube
Learn how to migrate your existing implementation to Google Tag Manager. We will discuss different scenarios you might encounter, including the Google Tag (p...
Published   October 23, 2023
🌐
Envigo
envigo.co.uk › how-to › marketing-analytics › how-migrate-google-analytics-google-tag-manager
Migrate from Google Analytics to Google Tag Manager | Envigo
Remember, a tag is a snippet of code that tracks user behavior and sends information about activities on a website to third parties. Today in this article, we are going to tell you how to implement Google Analytics code via GTM or how to migrate from Google Analytics to Google Tag Manager safely.
🌐
Bounteous
bounteous.com › insights › 2015 › 07 › 16 › safely-migrating-google-tag-manager
Safely Migrating To Google Tag Manager | Bounteous
July 16, 2015 - This is a guide for technically-proficient users who are looking to safely migrate from on-page Google Analytics code to Google Tag Manager. You should be comfortable with JavaScript, web applications, and web servers.
🌐
PPC Hero
ppchero.com › how-to-migrate-to-google-tag-manager
How To Migrate To Google Tag Manager - PPC Hero
August 2, 2024 - One of the most common hesitations in moving forward is not knowing how to talk about GTM and not understanding the process. This article will cover the standard process of migrating your tags to GTM.
🌐
Wolfenden
wolfenden.agency › home › insights › your checklist for migrating google analytics & google tag manager
Checklist: Migrating Google Analytics & Tag Manager | Wolfenden
August 9, 2023 - This post covers analytics considerations for Universal Analytics (GA3), Google Analytics 4 (GA4) and Google Tag Manager (GTM).
🌐
MarketLytics
marketlytics.com › home › blog › hitch free google tag manager migration in 5 steps
Hitch Free Google Tag Manager Migration in 5 steps - MarketLytics
September 2, 2016 - The steps that I have laid out below will help you keep your data safe. Create Code Specs for your Website which should define what code should be removed and added to website. ... Check what version of google analytics site is using.
🌐
Conversion Uplift
conversion-uplift.co.uk › home › analytics › how to migrate to google tag manager for google analytics
How to Migrate To Google Tag Manager For Google Analytics
September 9, 2024 - You can then set up a container for each website you plan to migrate to Google Tag Manager. Go to the Admin tab and select the ‘+’ icon in the top right-hand corner to create a new container. You can now give your container a suitable name to reflect the website name and select the type of platform you are going to track ... Click ‘Create’ and you will be taken to the page with the GTM script and instructions on it.
🌐
Reddit
reddit.com › r/googletagmanager › how do i migrate from google conversion tag to google tag manager?
r/GoogleTagManager on Reddit: How do i migrate from Google Conversion Tag to Google Tag manager?
August 12, 2024 -

Hi. I have looked for a guide on how to migrate from a Google Ads Conversion Tag to Google Tag Manager, but I cannot really find a good guide on this. I already have a Google Ads Conversion Tag setup and it has been working well for me for years. The existing Google Ads Conversion Tag script on my website looks like this:

<script async src="https://www.googletagmanager.com/gtag/js?id=AW-123456789"></script>

<script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'AW-123456789'); </script>

I have not created a Google Tag Manager account, and of course, I have not installed the Google Tag Manager script on my website yet.

The best I could find was this Youtube video but in that video, it just shows how to create a new Google Ads Conversion Tag in Google Tag Manager. Can I not use my existing Google Ads Conversion Tag or am I supposed to make a new one?

So I guess I am supposed to:

  1. Create a new Conversion Action in Google Ads (or can I reuse my current Conversion Action that is already setup with my Google Ads Conversion Tag above?)

  2. Get the Conversion ID and Conversion Label of this new Conversion Action

  3. Create a new Google Tag Manager account

  4. Remove the Google Ads Conversion Script above

  5. Install the Google Tag Manager script at the top of the <head> and <body> tags

  6. In GTM, setup Tag Configuration and copy the Conversion ID and Conversion Label here

  7. In GTM setup Triggering

  8. In GTM create a Conversion Linker tag

Did I get this right?

🌐
WordPress
wordpress.org › support › topic › migrating-gtag-to-gtm-within-sitekit
Migrating Gtag to GTM Within Sitekit | WordPress.org
June 9, 2023 - The Gtag is not visible in the standard GTM interface at this time. ... If you’re looking to migrate from using Site Kit’s placed Analytics snippet to using Tag Manager to insert your Analytics snippet, you can do so by following the steps below:
🌐
Google Support
support.google.com › tagmanager › thread › 11623106 › google-analytics-migration-to-google-tags-manager
Google analytics migration to google tags manager - Tag Manager Community
Skip to main content · Tag Manager Help · Sign in · Google Help · Help Center · Get started with Tag Manager · Get started with the Google tag · Manage user consent with consent mode · Manage accounts and containers · Concepts and components
🌐
GitHub
github.com › google › ga4-gtm-migration
GitHub - google/ga4-gtm-migration
Click GTM Migration > GTM Workspace Selection > List GTM Workspaces. Select a workspace. When you select a workspace, the workspace should turn green. The first two steps in migrating your Universal Analytics implementation to GA4 is to first ...
Starred by 119 users
Forked by 16 users
Languages   JavaScript