Stape
Search
Try for free

How to use pre-built GTM container templates for BigCommerce

Published
Nov 13, 2024

We, at Stape, have developed the GTM templates for BigCommerce websites. That kit includes all the necessary configurations for Google Analytics 4, Google Ads, and Meta. All you need to do is to customize them according to your needs.

In this article, we are going to show you how to configure the templates and to start using them.

Before starting

To configure the pre-built template, ensure you have:

Step 1. Download template files from GitHub

1.1 Download GTM Templates for BigCommerce from GitHub. Click on “Code” → “Download ZIP”.

Download from GitHub

1.2 When downloaded, unzip the file. We will use the first two highlighted templates, which include Meta, GA4, and Google Ads setup.

Unzipped file

Step 2. Import the templates into Google Tag Manager

2.1 Then, you need to import the templates. To do it go to Google Tag Manager account → Admin → Import Container.

Please note you need to import the templates for both - web and server GTM containers. The process is the same for both containers.

Import container

2.2 Select the template file from a desktop you downloaded and unzipped (ensure you upload the correct file that matches the container type - web or server).

Select the workspace for this import - new or existing.

Select Overwrite or Merge.

The "Overwrite" option can only be used if you have a new or empty container. For this demo, we are using the Merge option with the "Rename conflicting tags, triggers, and variables" setting enabled. This ensures that GTM will rename the tags without altering existing entities in your container if there are any conflicts.

Click “Add to workspace”.

Imported templates in GTM

Step 3. Configure the setup

3.1 Templates are fully prepared. They include triggers, payloads, and event names that are already configured. You just need to enter your specific destinations, IDs, API keys, and other details. For convenience, see the “Folder” section of web and server GTM containers. Here, you can find the folders that start with “[Stape]”; they store all the pre-built tags and variables.

Web

Folder in web GTM

Server

Folder in server GTM

All the tags and variables are already referenced in tags that use them; you only should change the data that fits your needs.

Variable from template

To configure the tags and variables for Meta, GA4, and Google Ads that meet your needs, you should have the following data:

a. For Meta settings, you will need Pixel ID and API token.

You can find the Pixel ID and API token in Pixel Settings:

Dataset ID
Generate access token

b. For Google Analytics 4 settings, you need to find the GA4 Measurement ID in Admin → Data collection and modification → Data Streams.

Measurement ID

c. Google Ads conversion ID and conversion label you can find when creating/editing a conversion goal in Google Ads.

  • Choose “Use Google Tag Manager
Use Google Tag Manager
  • Copy ID and label
Copy ID and label

Save changes.

3.2 If your GTM container is new, add a preview URL in your server container. To do it, go to Admin → Container Settings. If the container is not new, skip this step.

Add a preview URL

3.3 Test and publish the setup. The testing process is identical to making changes in the GTM container. Run Google Tag Manager preview, trigger events on the website, and see them in GTM.

Find more info on debugging and monitoring server-side tracking configuration in our other article.

Step 4. Boost tracking with Stape features

Once you have configured the basic server-side tracking for your BigCommerce website, you can connect Stape power-ups and features that will improve tracking accuracy:

The power-up developed by Stape ensures your marketing cookies are functional, even if they get deleted for any reason.

Custom Loader power-up improves the resilience of Google Tag Manager and Google Analytics 4 scripts against ad blockers and ITPs by adjusting the loading paths of gtag.js and gtm.js.

  • Custom Domain

If you add a custom domain, you can extend the cookie lifespan due to setting first-party cookies. 

See the detailed instructions on how to add a custom domain to the Google Tag Manager server container in our blog post.

Conclusion

Setting up server-side tracking for popular platforms like Google Analytics 4, Google Ads, and Meta is easier with the templates developed by Stape. All you need to do is customize the templates according to your case. That’s a good start for those who are just switching to server-side tracking.

Try Stape for all things server-sideright now!