How do I create events in Google Tag Manager using the import file?

To get you started quickly, we have created an Google Analytics 4 import file. This is a file to import into your container, containing variables, triggers, and tags that capture GTM ecommerce (GA4) data and send it to our tracker in the correct format.

By using this file you avoid having to create events separately. However, some users do choose to add events separately. For example, because the import file is too extensive, as it contains our most common events. Or because quite a few events are already set up in GTM.

Conditions:

  • The import the file is suitable for the Google Analytics 4 Enhanced E-commerce datalayer
  • The tracking script needs to be added to your Google Tag Manager first, please check the setup guide
  • The imported events does not have an email address as it is different per site. You need to add this manually

Disclaimer: Google Tag Manager knowledge is necessary

The import is a way to get you started and is purely a standard, based on the GA4 Enhanced E-commerce datalayer. It may be possible that some pages have a different datalayer and variables, such as the email variable. Please note you will have to edit some of the events yourself and Google Tag Manager knowledge is necessary. We will support you with questions you may have, but we cannot do the implementation in GTM, this is something you have to do yourself.

Import the file in Google Analytics

Log in to Google Tag Manager and ensure you are in an empty workspace. If workspace changes are not yet submitted, like in the screenshot below, contact the user who made the changes if the changes can be reversed or published. This will prevent you from publishing unwanted changes to your Google Tag Manager container. You can also create a new workspace where you only work on these changes and publish them.

GA 1.png

Before implementing the e-commerce scripts, ensure you have the base tracker added to your Google Tag Manager container. The e-commerce scripts won’t work without the base tracker on every (virtual) page view.

➡️ Download the import file (.zip)

To import this file into your container, navigate to the admin environment of Google Tag Manager and click Import Container. When importing the file, please select the correct workspace (probably Default Workspace), MERGE the workspace and RENAME conflicting tags. This prevents you from losing present tags. Example:

GA 2.png

After confirming the import, all tags, triggers, and variables are now present in your container, neatly stored in a folder.

Checking if the implementation is correct

All other variables, triggers, and tags should work out of the box if you implemented GTM ecommerce (GA4) events correctly. To check if that’s the case and everything is working, you can preview the changes from your container in the Tag Assistant and see if the newly added tags fire correctly on the corresponding pages and events.

For example, when you add something to the shopping cart, the add_to_cart event should appear, and when you click it (1), the newly added Squeezely AddToCart tag should fire (2):

GA 3.png

Please also perform other e-commerce events on your website and check if the corresponding tags fire.

Please note:

  • Especially take a good look at the triggering of the ViewContent & ViewCategory tags. The imported tags trigger on the “view_item” and “view_item_list” events, but these events are also triggered on other pages on some websites. If this happens, you should set another trigger for these tags in GTM, like pageType data in your dataLayer.
  • An email address is a very important identifier to get a nameless cookie to an identified profile. The imported Purchase event does not have an email address as it is different per site. Please add the email address to the Purchase event if possible.

You can check the Spotler Activate events in Live events.

Publishing your workspace to the live environment

After checking, don’t forget to publish the changes by clicking the blue Submit button in the top right corner. After clicking, GTM prompts a confirmation window where you can enter a title and subscription for the changes.