Siden 2010 har vi hjulpet virksomheder med at designe og udvikle stærke digitale webprodukter samt leadgenereringsindsatser.

Månedlige nyheder du rent faktisk gider at læse

Data insights

22. oktober 2022

Google Tag Manager setup

This post is structured as a guide on how to set up Google Tag Manager (GTM). In the guide, we cover event tracking in Google Tag Manager, as well as how it can then be connected to Google Analytics.

Indhold

Opsætning Konfigurering Eventsporing Konklusion Undgå faldgrupper

The 3-step rocket

The events you have set up in Google Tag Manager (GTM) can be used to create and track goals and give you more control over tracking any conversion you may want to collect data on.

  1. First, you will find a 5-step guide on how to set up your Google Tag Manager.
  2. Next, you will be taken through 24 points on how to set up tracking in GTM.
  3. Finally, we guide you through how to import your goals into Google Ads.

Setting up Google Tag Manager

This section is a detailed guide to setting up tracking via GTM—so if you already have that under control, simply skip ahead to the next chapter.

  1. Go to https://tagmanager.google.com/
  2. Sign up for a free account by clicking “Create account” on the right-hand side.
  3. Fill in the fields about your company, your website address, and whether it is an app, a website, or something else you want to track.
  4. Tick the “Accept” checkbox at the bottom of the terms of service, and then click “Yes” in the top-right corner.
  5. A modal box will now appear with two pieces of JavaScript that you need to add to your website’s code in your CMS backend.
    One tag must go in the <head> file, before the final </head> tag. And the other in <body>, so that in the future you can insert scripts into these files via GTM.

That’s it—GTM is set up. Now for setting up tracking.

Configuring GTM and setting up tracking

  1. Start by going to “Variables”, then click “Configure”.
  2. Tick the following in the menu that appears on the right:
    – Click Element
    – Click Classes
    – Click ID
    – Click Target
    – Click URL
    – Click Text
    – Form Element
    – Form Classes
    – Form ID
    – Form Target
    – Form URL
    – Form TextYou can also tick more, so you can track, for example, scroll and video views, but this is not important for lead generation.
  3. Click the X in the left corner of the box.
  4. Click “Submit” in the top-right corner, then “Publish”, and finally “Continue”.
  5. To track events via GTM, you first need to find a unique parameter to track. Start by creating a “Preview” with the landing page you want to track.
  6. Click “Preview” on the right-hand side.
  7. Enter the URL of the page you want to track.
  8. Tag Manager will now open the page you want to track. Here you can click buttons, fill out forms, etc., so you can see which events are fired when you do so.
  9. Once you have clicked around the page and performed conversion actions, you can go back to GTM and see which events were fired, so you can find something unique to track.
    In the example below, we have filled out a contact form. Now we know a unique variable that only occurs for this event. Then we can set up tracking for the event.
  10. Go to “Tags” in the menu on the left, and click “New” in the top-right corner.
  11. Give the “tag” a name, and start by creating a “Trigger”.
  12. Click the small blue “+” in the top-right corner.
  13. Give your trigger a meaningful internal name, then click “Trigger Configuration”.
  14. A box will now appear on the right, giving you a range of tracking options based on the action you performed. In the case of this contact form, it was a “Click” event, and no link was clicked, so we choose “All Elements”.
  15. Since you do not want to track all clicks, choose “Some Clicks”.
  16. Fill in the box that now appears based on the unique event you found. Our event was a so-called “Click Classes” that contains “wpcf7-form-control has-spinner wpcf7-submit button default”.
  17. You have now finished the trigger—i.e., the event that triggers an event. Now you can define what happens when this event is triggered.
    Now click “Tag Configuration”.
  18. Another list of options will now appear. Here you choose GA4 Event (this of course requires that you have set up GA4).
  19. Select “GA4 – Configuration” in the first dropdown, and give the event a meaningful internal name (this is the name the conversion will have in Google Analytics, so choose carefully). 😉
  20. Click “Save” in the top-right corner.
  21. You will then return to the overview. Now click “Submit”, then “Publish”, and finally “Continue”, just like last time.
  22. You can now go to “Preview” mode and perform the conversion action again to see whether the tag you just created is fired now—if yes, then tracking works.
    You can check in the “Tags” tab which tags are fired for a given event. In the example below, we clicked a phone number, and the event that tracks clicks on phone numbers is correctly fired.
  23. Now go to GA4 at analytics.google.com and log in with your user.
  24. Select “Configure” in the left-hand column, then click “Events”.
  25. Below, your newly created GTM event will automatically appear after 48 hours.
  26. Now simply tick “Mark as conversion” for it to become a conversion event.

Import conversions into Google Ads

BOOM—you have now set up tracking for a contact form. Now you need to repeat the process x times to cover all your conversion events. Yes, it takes a bit of time, but it is also something you only need to do once.

To use your tracking for lead generation, the conversion events you set up in GA4 must be imported into Google Ads or LinkedIn.

Below is a guide to importing conversions in Google Ads:

  1. Log in to your Google Ads at ads.google.com, and select the profile you are working from.
  2. Click “Tools and settings” in the menu at the top right (the one with the wrench).
  3. Navigate to the “Measurement” column and click “Conversions”.
  4. Click the large blue button in the top-left corner, “New conversion action”.
  5. Then select “Import”.
  6. Click “Google Analytics 4 properties” and then “Web”.
  7. You will now see an overview of conversion events that you can import into Google Ads. Tick the events to be imported, then click “Import and continue”.

Conclusion

That’s it—now you have the tracking foundation in place. You have now come this far:

  • You have set up tracking
  • You are now ready to set up campaigns.

 

Avoid these pitfalls in Google Tag Manager tracking

  • Be careful not to track too much—but of course also not too little. It is easy to get carried away tracking everything, but for each conversion event you set up, it becomes harder to distinguish which conversions a given campaign has generated.
    You risk prioritising budget for, for example, a campaign that generates traffic that scrolls far down the page, rather than the campaign that generates leads in the form of contact form submissions.
  • Stick to conversions in the “leads” category—whether they are MQLs (email sign-ups, brochure downloads, etc.) or SQLs (get a quote or a call)—you should “only” track the leads that sales handles.
  • Remember to check, double-check, and triple-check that tracking works correctly.
  • All companies that truly want to take lead generation seriously should set up call tracking, so you can actually track incoming calls. You can set it up so that only traffic from selected channels is affected, and also so that only selected phone numbers are included—so sales numbers are tracked but support numbers are not. Read more about call tracking here.

Relaterede indlæg

Stop spam traffic in your advertising and save up to 10% of your budget

GA4 vs. Piwik PRO – which is best?

Relaterede indlæg

Stop spam traffic in your advertising and save up to 10% of your budget

GA4 vs. Piwik PRO – which is best?

Get in contact

First step in your business development

We are already just waiting in suspense to hear from you! We love helping passionate companies that also have great digital potential.

Rugårdsvej 55A 1. floor
5000 Odense C
Nyhavn 16, 4. floor
1051 Copenhagen K
Write us
Book a meeting
Job og Karriere
Find contact
Write us

First step in your business development






    You are a star

    Thank you for your message

    You should now have received a confirmation email.
    We are reviewing your inquiry and will get back to you as soon as possible.

    Have a great day! ☀️

    Book a meeting

    Talk with us, when it suits you

    Hvornår?

    Vælg dato

    Ledige tider

    Book a meeting

    Thank you! - We need to know a bit more about you






      You are a star

      Thank you for your request

      You should now have received a confirmation email.
      We are reviewing your inquiry and will get back to you as soon as possible.

      Have a great day! ☀️