
December 7, 2022
Google Tag Manager vs Google Analytics: What’s the difference?
Updated: December 7th, 2022
When I first heard about Google Tag Manager (GTM) in early 2013, I felt a bit confused. At that time, I had no idea that tag management was a thing, so naturally, I found myself questioning what is Google Tag Manager? What’s the difference between Google Analytics events and GTM events?
And nowadays, I still notice this confusion among many beginners. In this blog post, I’ll compare Google Tag Manager vs Google Analytics and show you the main differences.
Spoiler alert: they do not replace each other. They are meant to be used together.
Video tutorial
If you prefer video content, here is a tutorial from my Youtube channel about this topic.
Google Analytics In a Nutshell
The main purpose of Google Analytics is tracking data, storing it, and generating reports about your website, for example:
- how many people visited your website yesterday?
- what country are they from?
- how many pages did they view per session?
- how many visitors bounced off your website (without performing any action)?
- which pages were the most popular, etc.?

The main way Google Analytics can track these user interactions is with the help of tracking code (also known as GA Javascript code snippet) that must be placed on every page of your website.
Once an interaction occurs on a site (e.g. pageview), a Javascript snippet sends the corresponding data to Google Analytics.
There’s no problem if you want to put the GA tag on all websites and track general information like page views, bounce rate, session duration, referrals, etc. However, you’re limiting yourself big time.
You may want to track how many people use a specific feature on your website/app. Or maybe you are interested in tracking sales, huh? In this case, you’ll need to add custom tags – Google Analytics events that send the data only when a visitor completes a particular action on your website. A good example here could be a form submission.
So what do you do here? Ask the developer to add that form submission tracking tag to a website (directly in the code), right? But what happens when there are tens or hundreds of interactions you are willing to track with Google Analytics?
Unfortunately, it will require much more developer time (and they are always very busy!). It might take weeks or even months to get your marketing tags up and running, which is a real bummer.
Google Tag Manager to the Rescue!
Google Tag Manager makes it easier to manage this mess of tags by letting you define the rules of when certain tags should fire, but first, let’s take a quick overview of GTM.
If you prefer video content, here is what GTM does in a nutshell:
Google Tag Manager is free software from Google that allows you to deploy various types of code (tags) to your website. Some good examples of a tag would be Google Analytics tracking code, Google Analytics event codes, Google Ads conversion script, and remarketing tags. There are many more types of code that can be added to your website using GTM, including custom codes.
Google Tag Manager does not replace Google Analytics. Instead, it helps users to easily add Google Analytics tracking code (tag) to a website, deploy GA event code snippets and define rules when each code must fire.
Before GTM, GA tracking codes had to be hard-coded, usually by a web developer, on each page. Having hundreds of events is very difficult when it comes to maintaining/updating them. But Google Tag Manager solves this problem because all your tags are stored in one place – your GTM account.
Imagine that Google Tag Manager is a Toolbox where you keep all your tools: a ruler (Google Analytics), a hammer (Google Ads), etc.
Google Tag Manager also lets you test your tags to ensure they are triggered when you load the right page or click a particular button. Another great benefit: you can change your tags and the way they work without actually changing the source code of your website (which you may not be able to do because of slow-release cycles or the busy schedule of developers) – instead, you just edit tags in GTM user interface and publish changes with a click of a button.
Google Analytics is not the only tag compatible with Google Tag Manager. Other examples include:
- Google Ads Conversion Tag
- Google Ads Remarketing Tag
- Facebook Pixel code
- Crazyegg tracking code
- Any other custom HTML/Javascript code.
What is the difference between Google Analytics and Google Tag Manager?
They are two different things that serve two very different purposes.
Google Tag Manager lets you manage various Javascript tracking codes (also known as Tags) on your website. Google Analytics tracking code is one of those tags.
Google Analytics is an analytics tool that provides reports. Google Tag Manager has no reporting features. It sends data from your website to other marketing/analytics tools (including GA).
If you don’t want to use Google Tag Manager, that’s fine. You can continue adding Google Analytics tracking codes directly to your website’s source code (but keep in mind that you, as a marketer/analyst, will lose a lot of flexibility).
Example
As I have previously pointed out, Google Analytics is a Tag. According to GA instructions, you need to place the GA tracking code on every website page. A sample tracking code should look like this:
<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-83848370-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-XXXXXXX-X'); </script>
Google Tag Manager offers a default Google Analytics tag template, so setting it up is fairly easy. After you install GTM on your website, go to Tags.
- Click New
- Click the Tag Configuration block and choose tag template – Google Analytics 4 Configuration
- Paste your GA4 data stream’s measurement ID
- Click the Triggering section.
- Choose All pages.
Congratulations! You just created a Google Analytics Pageview tag in Google Tag Manager. It will track pageviews on all pages which have GTM container snippet installed. All pageviews will be sent to Google Analytics property). If you have enabled Enhanced Measurement, GA4 will automatically track other events too.

Google Tag Manager vs Google Analytics: Events
In Google Analytics, events can be found in various reports, e.g. Engagement > Events. They represent interactions that happened on your webpage. The data for this report is populated from Event hits that are sent from your website to Google Analytics servers. Before the birth of Tag Management systems (like GTM), Event hits had to be initiated by small Javascript codes placed on your website. Here’s an example:
gtag('event', 'login', { method: 'Google' });
As you can see, this code snippet contains the event name and a parameter method). After a particular action occurs on your website (e.g. user logs in to his/her account), the Google Analytics Event will be fired, and the corresponding data will be passed onto Google Analytics.
Then you can see those events in the GA4 DebugView and, after a while, in other reports.
Now let’s talk about Google Tag Manager events. To see them enable GTM’s Preview and Debug mode by clicking the Preview button in the top right corner of the Google Tag Manager interface.
After you enable Preview and Debug mode, it will be opened in a new tab, and then your website will be loaded in a separate browser tab/window.
Once the preview mode is enabled, navigate to the preview mode’s tab (its URL will contain tagassistant.google.com), and you will see information about your tags, including their firing status and what data is being processed. If it does not work, read the guide explaining how to fix GTM preview mode.
On the left side of the Preview and Debug console, you should see a list of some definitions, e.g. Container Loaded, Window Loaded. These, my friend, are Google Tag Manager Events.
They play a very important role within GTM – you can fire your Tags (scripts of various marketing tools) based on these Google Tag Manager events. Here are a few examples to make it easier to comprehend:
- Container Loaded Google Tag Manager Event can be used as a trigger to fire Google Analytics 4 Configuration tag.
- A Link Click occurs when a certain element with a link is clicked. For example, when someone clicks a PDF link on your website, you can send this click as a Google Analytics event (and see it in your reports). P.S. Out of the box, you won’t see any events except Container Loaded, DOM Ready, and Window Loaded. To start seeing events, you need to have at least one trigger of that type enabled in the container. Here’s an example of how to track link clicks and button clicks.
- A Form Submission GTM event (when a visitor submits a form) can trigger another Google Analytics 4 Event Tag (that sends an event with the data of the submitted form to GA reports). Form Submission GTM event can also be used as a trigger to fire a Google Ads Conversion Tag (or any other tag you want – it’s up to your imagination). And don’t limit yourself just to these tags.
- Since all Google Tag Manager events are populated in Data Layer, you can also ask your developer to fire custom Google Tag Manager events (a.k.a. “Data Layer Events”).
To sum up, the Google Tag Manager event is an interaction on your website that is spotted by GTM and then placed in the Data Layer (p.s. Data Layer is automatically created on your website when GTM container code is implemented and published).
That interaction on your website can be used as a trigger (condition) to fire your tracking tags (scripts), e.g., Facebook Pixel, Google Analytics Events, Mixpanel Events, Google Ads Tags, etc.
So as you can see, Google Tag Manager is the middleman in your Analytics implementation. It observes interactions that occur on your website, creates GTM events, and then uses them to fire tags (e.g., Google Analytics Event). Although the term Event is the same in both Google products, in Google Tag Manager, a GTM Event is a triggering condition, while GA Event is a Tag.

What about Google Analytics Conversions?
If you read all the comments below this post, you will notice several repeating themes. One of them is Google Analytics goals/conversions. How should one configure them with Google Tag Manager?
Regarding the relationship between GTM and GA, Google Tag Manager is a way of data transportation that sends various interactions (page views, events, etc.) over to Google Analytics.
Some of those interactions are more important than others (say, a newsletter subscription or visiting the “Order confirmation” page), and they are called conversions. How does Google Analytics understand which interactions are more important than others?
You do that by configuring GA (not GTM).
If you’re working with Google Analytics 4, you need to go to Configure > Events and mark the most important events to you as conversions. Learn more here.
In other words, you tell GA that some interactions (that are sent to GA) are more valuable to the business. And it does not matter how that interaction was sent to Google Analytics, whether it’s via GTM, or directly from the website’s code, or somewhere else.
Do you see the difference? GTM is a way to pass the interaction data to Google Analytics. Conversions are valuable interactions that are configured in the GA interface.
Migration to Google Tag Manager
If you run a site that is using hardcoded Google Analytics and you want to migrate to GA + GTM, there are several things you need to keep in mind. If migration is done wrong, you will break your setup, and new data will be lost/corrupted.
In general, you will need to remove the hardcoded GA codes from your website and add the Google Tag Manager container code to all pages of the site. Then you will fire Google Analytics tags via Google Tag Manager.
Your historical data will not be lost, but the migration can negatively affect your future data (if done incorrectly). Subscribe to my newsletter (below) and download a free E-Book “Google Tag Manager for Beginners”. That e-book contains a chapter on migration to Google Tag Manager + Google Analytics.

Still not sure if GTM is worth your time?
It’s perfectly fine if you are still hesitant about GTM and whether to start using it. I’ve published another guide that lists why GTM is worth becoming a part of your digital analytics/marketing stack.
Google Tag Manager vs Google Analytics: Conclusion
I hope this blog post made sense to you, although some parts of it might look really tricky. In a nutshell: GA is the analytics tool that provides reports about activity on your site. GTM is a tool that fires your tracking codes based on defined rules. In the end, you can either implement GA code on your site directly or implement the GTM code on a site and use GTM to fire your GA code.
If you want more specifics, here are the main points that should be emphasized once more when it comes to comparing Google Tag Manager vs Google Analytics:
- Google Tag Manager does not replace Google Analytics. Instead, it helps users easily add Google Analytics tracking codes (tags) to their website, deploy GA code snippets and define rules when each tag must fire.
- Google Tag Manager is the middleman of your digital analytics implementation on any website. If you want to add Google Analytics Tracking code or events, it’s recommended to do so with GTM because you don’t need to change the website’s code constantly. Therefore, your deployment process is faster.
- Google Tag Manager can exist without Google Analytics and vice-versa. Your developers can hard-code Google Analytics codes directly to your website. But if you constantly need to publish changes, only developers can help you here. But with GTM, you could add/edit/remove your Google Analytics Tracking codes all by yourself. You can also use Google Tag Manager to add Facebook, Google Ads, or other tracking scripts to your website (leaving Google Analytics behind).
- Google Tag Manager Events are used as triggering conditions that define when a certain tag must be fired. Google Analytics event in this context is a Tag. Example: GTM event formSubmission can be used as a trigger to fire a GA event tag called “form_submission”.
- You cannot create Google Analytics goals/conversions in Google Tag Manager. GTM sends events to GA. Goals/conversions are configured inside Google Analytics, where you instruct GA to turn some regular interactions into more important/valuable goals.
If you feel that the “Google Tag Manager vs Google Analytics” topic is still not clear, post a comment below, and I’ll see how I can help you.

64 COMMENTS
Nice article! Do you think it's better practice to put the GA tracking code inside GTM or for both codes to live separately on a website?
Hey, it's better to install GA via GTM. That's the whole point.
After you implement GA via GTM, you'll be able to add/edit/remove tracking codes anytime you want and usually without developer's input. Here's a list of various Google Tag Manager templates that will help you track a lot of interactions in no time.
If I am currently tracking through GA and wish to switch over to GTM will i lose any historical data in GA?
Hey, you will not lose historical data because you can connect your existing GA account via GTM.
Excellent article! You cleared up some of my confusion for sure. I certainly understand the role GTM plays in the ease of deploying tags and events, but what I still find confusing is the redundancy. That being - I can setup an event goal in Analytics for a form submission but I can do the exact same thing in GTM. Yes, I understand that without GTM I would have to deploy the event tracking code myself, but I'm still confused as to whether I have to create an event goal in Analytics if I already created the same event trigger/tag in GTM.
It does not matter, how the event was sent (via gtm or via hardcoded ga). In both cases you will have to create an event-based goal in GA. GTM is just a way of how the data is sent to GA.
Hi,
I'm facing issues with one of my clients' GTM account. Currently, there exist 2 GTM's in the website for which they doesn't have access. Also, the GA is configured via GTM for which we have full admin access.
If we create a new GTM from our end then will it affect the tracking/readings in Analytics.
Please guide as how to go about it & what will be the impact of adding new GTM.
If not properly monitored and configured, multiple GTM containers on the same page will cause issues. Not only to GA but to the entire container. Unless it is really planned to have multiple containers, I'd remove the first two containers and implement the new one.
However removing two old ones will also be challenging because if they have some important tracking, you will have to implement the same tracking codes in the new GTM container. The process:
- You implement all the necessary tracking in the new container
- Test it
- Remove the old containers and install the code of the new container to the website.
Something similar is explained here (except, that in your case there are no hardcoded tracking codes. You'll need to migrate from one GTM container to another.
Thanks for the wonderful article. I'm new to an organization and I hope to check if some elements on the organization's website are instrumented by GTM. when I add a tag for an event, will that code on the website be visible to everyone by checking the 'inspect' button through chrome browser?
It's possible. It depends on what that tag does.
Hey thankyou for this post, is so usefull.
I have some doubuts with GTM events, gtm.click, gtm.js, gtm.dom...
Can we manage them? for example, a gtm.click event is sent in every user click (even in no link clicks). Are all this events affecting negatively in our page loading time, or other aspects of the web?
And is it possible to configure gtm.click to be sent only in an especific clicks?
Thankyou!
Update your triggers to listen only to certain gtm.click events. For example, when Click URL contains xxxxx
Hi Julius Fedorovicius,
You are doing well. you advise I will follow.
I have one question about google analytics.
I am using google analytics code but I want to create a GTM account.
If I installed GTM code on the website so then I should remove google analytics code.
Please help me about google analytics & google tag manager doubt.
I hope that you will reply fast.
Thanks & Regards,
Nimesh Koshti
Yes, if you install GA via GTM, you need to remove the hardcoded GA from the website's source code.
Great article!!! Thank you.
We have set up Google Tag Manager and find that it is very useful however the question I can't get an answer to is why is there a discrepancy between Pageviews in GA and Pageviews setup in Google Tag Manager? They just don't match. I would appreciate any help with this :)
Pageviews via GTM will never match pageviews from hardcoded GA. IF the discrepancy is ~3%, that's still fine. There might be many reasons why pageviews are not matching. Maybe a developer did not include the GTM snippet on all pages. Maybe you have implemented the GDPR consent banners and not all people give consent. Maybe some issues with browsers and GTM did not work on some of them. Maybe ad blocking extensions had something to do with it.
I have been going back and forth with my marketing team on whether to keep GTM or just use GA. GTM is slowing down our page speed since it fires first. We were trying to figure out how we can improve our speed on our site. The problem is we're connecting out to Facebook, LinkedIn and HotJar (and Google, obviously) before anything else on the page loads. For speed purposes (also SEO, since Google loves speed) js files usually load in the footer, allowing images, content and styles to load faster, displaying everything on the screen before all of the javascript is retrieved and parsed. Analytics is the one thing I keep near the top so that reporting shows bounces properly. Can we keep Google on top, but the other three I mentioned, are we able to move them to bottom? So, if GTM doesn't have a way to split. I was considering taking everything nonGoogle out of GTM, and have them load within the footer. Does that work or makes sense?
In your case, not GTM but the tags within it are slowing the page.
With GTM, you can control WHEN to fire those tags. For example, Linkedin's tag is very slow, therefore, you can set it to fire not on "All Pages" (a.k.a. Pageview) trigger, but to create another one, called "Window loaded". That way, those tags will fire ONLY when all other page resources (including JS) are already loaded.
All in all, you can fire analytics on Pageview, pixels can be fired on "Window loaded".
if i have both GA and GTM installed on my site, is my user info duplicated and tracked twice?
Yes
Every time you install Facebook Pixel or Analytics, one HTTP request or more are generated per item inside the website which can affect speed performance, my question is with Google Tag Manager how many HTTP request will be generated? Just one? The one from GTM? Or also HTTP request from Facebook Pixels or other tags we be generated?
One from GTM container and the rest as usual. Everything depends on when you fire pixels. You can delay FB pixel with GTM and fire it later, after everything else has loaded, thus lower the negative impact on performance.
Hi, Great article! Maybe you can help me understand something I still haven't been able to understand from any articles I search and read on the web. If I use google tag manager to deploy google analytics do I need google analytics code on my website as well? The issue or dilemma that I'm facing is that I'm afraid there is some old analytic code on my site which isn't necessary anymore since I have google tag manager and I just am uncertain if I need both!? If not I would like to know how I can remove the old analytic code that was manually installed on my site before the google tag manager came along so that my site speed isn't affected negatively.
If you check could you please check the english version of the site as well. I'm sure once I know or am shown for sure that in fact I need to remove some old code I might be able to figure it out.
Thanks
Sincerely,
Daniel Casden
You need to remove old GA code from the site.
There is no single solution how to remove the code. It depends on how that site was created. Contact the developers of the site and ask them to remove the old code. Or if you are using a plugin - disable it. But at the same time you need to launch the GA via GTM on the site.
Hi thanks for the great article - really helpful stuff. I have just acquired a website that uses GA tracking code directly on the site, but i'd like to switch it to the GTM code and run the GA code through GTM. Can you foresee any issues with this? Any danger of data loss etc?
Yes, there is definitely danger in data loss if migration is not managed properly. I've added an additional section to this blog post about migration. It refers to my free ebook that gives tips on migration.
Hi, I have added google analytics via monster insights plugin into our site. The GA has started tracking data. After 5 days, we have created GTM account. Now, I want to set up Google analytics via GTM only. what are the possible options. I don't want duplicate data. what will be the best solution. If I create GA tag/all page views inside google tag manager will it double the data? Should I remove GA connection from the plugin and use GTM only? If we choose this option, what about the historical data? can I still check the website traffic in GA as it is?
If we keep both GA and GTM, how it will work? for example GA has to be connected through a plugin - no change in that
Don't create GA-all page view tag in GTM
Also, I am bit scared if we will only use GTM for everything including GA and just in case we forget to publish the latest version, will this affect on any data? or having an issue in one tag can affect other things?
Hi, the migration process is explained here https://www.analyticsmania.com/free-e-book-google-tag-manager-beginners/
Hello, thank you for your nice post.
I have a problem in my site and I want to know if there is solution. I use google tag manager and google analytics in my opencart store, but I received different number of orders in opencart dashboard and different number in the google analytics dashboard. Why happened this?
Many possible reasons https://www.analyticsmania.com/post/missing-google-analytics-transactions/
P.S. you will never reach 100% accuracy. That's just how things work.
One question i have is, isn't it easier to create goals in GA rather than GTM? When creating an event goal for ex in GTM, one must to create variables, triggers etc, and then still go back to GA reproduce it so it appears in GA. But in GA it would be a one time action. Or am I missing something?
You cannot create goals in GTM. You create events and then set them as goals in GA. This is the same principle as if your developer sent events to GA and you set the as goals.
Hi Jilius,
Thanks for the wonderful post. I am new to GTM. We already have google analytics code installed on our website. Recently we needed few events to be tracked and for that we thought of using GTM. Hence we implemented GTM code also on the website but we didnt track page views to avoid duplicate data on analytics. When we tried to track two events together via GTM. One event is showing data on analytics but the other is not. While testing the tags are getting fired correctly. But somehow data is not updating on analytics event. Can you let me know where i am getting wrong.
You might find some clues here https://www.analyticsmania.com/post/google-analytics-real-time-reports-not-working/
Hello Julius,
What about the tag firing option? While implementing GA which tag firing option i.e. once per event or once per page is good to choose? Is any of the option is responsible for not tracking sessions properly in analytics as we have recently seen in one of our account that analytics is not counting on session properly and we have selected once per page in the GTM. Is this could be the reason?
Thankyou
Depends on a website. On single page applications you should choose once per event.
On regular websites, both options work the same way.
Hi Julius,
There is a parent site which has used a GTM, on click of some button it redirects to our application in new tab. The question, can the same GTM used in parent site to be used in our application or do we need to ask them to create a new GTM ?
Only you can answer this question. Read this https://www.analyticsmania.com/post/how-many-google-tag-manager-containers-do-you-need/
If my web developer added both GTM code and Google Analytics code to the website, can they happily live together, as long as I don't add a duplicate GA tag through GTM? Will there be any disadvantages in terms of page speed or some reporting features? I don't want to make anyone do unnecessary work "just because" if it doesn't really make any difference.
Page speed will probably be affected just slightly. They can live happily, but if you ever decide to send a hit-scoped dimension with that pageview, you will need the developer's input. In the long run, I'd recommend complete migration to GTM.
Hello,
Thank you for the super useful summary! I'd have one question. What do you mean Facebook script can be put in Google Tag Manager? May I ask you to detail it? Thank you
I mean Facebook Pixel. It is a tracking code.
If using Google Tag Manager and Google Analytics, do you still need to include a reference to analytics.js?
You don't need to do that manually
Does Tag Manager automatically add it to the pages, or will it not need to be referenced at all and it should still work?
Good Day,
I have recently switched over to using just GTM for all my tracking.
When I check my Google Tag Assistant, there is still a Google Analytics Tag (Not a global site tag) being fired. Is this normal?
If you have GA tag in GTM, then yes.
I have been setup and using GA for years. and all of a sudden on the 5th of May 2021 GA stopped reporting $$ Revenue. No code changes were done to the tags or the conversion goals or site code.
Did Google have an update or change the configuration for GA to report revenue??
Most likely something broke in your setup. There was no update.
hello, thank you for this great article. But i am curious, GA automatically track page views and clicks to start with, why do you need to setup the "create a Google Analytics Pageview tag in Google Tag Manager. "? Won't it duplicate the pageview count on each page?
How else do you expect to install GA? Pageview tag, a.k.a. Config tag activates GA so that it can track things like pageviews
Execuse me, would you please explain more? I mean, GA tracks those simple things like pageviews itself, so why do we set that tag in GTM?
How do you install GA on a site? You either add a code to a site, or you install it via GTM. If choose GTM, that's when you must add a tag
Thank you so much for explaining this, its been confusing me! Very well explained too, thanks.
Hi, I am new to Google GTM AND GA. I want to implement GA for the ReactJs web app. But I am not sure how to set up a website with GTM and GA. Can you please help me where to start.
Start here https://www.analyticsmania.com/post/single-page-web-app-with-google-tag-manager/
If this sounds too complex, then enroll in my GTM course for beginners to get the proper foundations of GTM https://www.analyticsmania.com/courses/google-tag-manager-course-for-beginners/
Dear Julius,
One point is making me crazy. I am not sure when to create GTM tag and when to create goals in Google analytics?
Once done both, where those two reports shown in Google analytics?
Another confusion regarding conversion tracking with google ads. It will be great if you please outline the use case of those three and point out where to look for the report in google analytics.
Hi Julius,
thanks for the article.
We use a booking platform for our ticket sales and they've provided us the GA code to track the sales they make back to our website. Our developer uses GTM.
All of the sales data is registering as coming from Direct / (not set) and not from the actual acquisition source. I want to where our sales are actually coming from. Can I get a GTM tag to feed through the acquisition data?
Sounds like something else is broken in your setup. GTM might help with that (but not necessarily). Providing an answer requires a full audit of your setup.
Which would you prefer a person learns first?
GMT or GA?
Both. With larger focus on GA. But it depends on what your end goals are.
Hi Julius,
I got a query and I would be grateful if you make out some time and solve my query.
Let's say I already have a GA account with an email id, [email protected] and I don't have a GTM account yet.
When I want to create a GTM account, do I have to use the same email id, [email protected]?
No, you don't have to
Hi Julius,
Thanks for the clear article. I'm still wondering. I have the Googletagmanager script but actually only use the standard functions of Analytics (content website no shop with conversions etc). Now I saw that a test with Lighthouse without that code yielded a small 20 point speed gain if I completely removed that code. Then of course I don't have Analytics at all, so that is not desirable, but is there anything to be done about the fact that that code takes up so much performance?
This is de code i have
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxx-1');
</script>
Nothing more....
Thanks in advance for your answer
Best regards, Nathalie from Holland