All Collections
Campaign Analytics
Tracking events with GTM
Tracking events with GTM

How to set up tracking in your campaigns with GTM and GA4

Anders Lund avatar
Written by Anders Lund
Updated over a week ago

Tracking users in your campaigns through GTM using button clicks and Google Analytics 4 (GA4) events is a very effective way of gathering data. In this article, we will guide you through the process of creating a GA4 event in Google Tag Manager when a user clicks on a button with the ID “linkedinbtn.”

In this article you will learn how to:

  • Set up GTM with Playable through your GTM-ID

  • Give a button in Playable a trackable ID

  • Create a GA4 Event Tag

  • Create a Trigger step in GTM

  • Publish and test your button and tracking

Setting up Google Tag Manager

You can add your Google Tag Manager ID to the platform under Account. First, go under the tab “Admin”, then select “Developer” and in the sub-menu, click on “Scripts”.

Enable google tag manager and add your ID.

Select the button you want to track

In the frontend editor, select the button you want to track. Under the Content tab add a Button ID, this will be used later when setting up the trigger in GTM. In this example the Button ID is "linkedinbtn".

Creating a GA4 Event Tag:

  1. From the left-hand menu in Google Tag Manager, go to the “Tags” section.

  2. Click on the “New” button to create a new tag.

  3. Give your tag a descriptive name, such as “GA4Event”

  4. Under the “Tag Configuration” section, select “Google Analytics: GA4 Event” as the tag type.

  • Configure the tag as follows: Event Name: Enter a unique name for the event, such as “LinkedIn Button Click.”

Create a Trigger in Google Tag Manager

  1. Log in to your Google Tag Manager account and navigate to your container.

  2. Go to the “Triggers” section from the left-hand menu.

  3. Click on the “New” button to create a new trigger.

  4. Give your trigger a descriptive name, such as “LinkedIn Button Click.”

  5. Under the “Trigger Configuration” section, select “Click” as the trigger type.

  6. In the “Some Clicks” section, click on the pencil icon to edit the trigger configuration.

  7. Choose “Click ID” as the condition.

  8. Set the condition to “contains” and enter the ID of your LinkedIn button (“linkedinbtn”).

  9. Save the trigger.

Publishing and Testing

  1. Click on the “Submit” button in the upper-right corner of the Google Tag Manager interface.

  2. Add a descriptive version name and description for the container version.

  3. Review the changes and click on the “Publish” button to make your changes live.

  4. Test the implementation by visiting the webpage with the LinkedIn button and clicking on it.

  5. Open the Google Analytics 4 interface and navigate to the “Events” section to verify that the LinkedIn Button Click event is being tracked correctly.

Did this answer your question?