> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/getting-started/using-adpage-templates.md).

# Using AdPage Templates

Import ready-made web and server container templates

To get the right tags, triggers and variables into your Google Tag Manager containers, we've built ready-made templates for both the web and the server container. These templates cover the following webshop platforms: WooCommerce, Shopify, Magento and Lightspeed.

You can find them in the template library on our platform: <https://data.adpage.io/template-library>

{% hint style="info" %}
Do not use these templates for websites or webshops that don't run on Shopify, WooCommerce, Magento or Lightspeed.
{% endhint %}

### Before you start: the AdPage e-commerce dataLayer

For webshops on WooCommerce, Shopify, Magento or Lightspeed, you install the Tagging Pixel to replace the Google Tag Manager script, and along with it you install the AdPage e-commerce dataLayer.

These dataLayer events use a `trytagging_` prefix. That prefix exists so our events never collide with events that are already being pushed by your theme, another plugin or an existing GTM setup. No duplicate events, no double conversions.

Our templates are built entirely on these `trytagging_` events. So the templates only work if the Tagging Pixel and the e-commerce dataLayer have been installed correctly first. If you haven't done that yet, follow the Tagging Pixel instructions for your platform before importing anything.

### Generating the templates

In the template library you'll find two things:

**Individual templates.** \
Web and server container templates per marketing platform, so you can pick exactly what you need.

**The container template generator.** \
Here you select the marketing platforms you want to set up and the Consent Management Platform you're using. The generator then builds complete, ready-to-import container templates for both your GTM web container and your GTM server container, already wired up for your consent setup.

Either way, you end up with JSON files: one for the web container, one for the server container.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fc7yqPCtZXN1MWJuFcef4%2Fimage.png?alt=media&amp;token=fa9cdfb9-6bf0-499b-aa53-31cd6cd0bbfa" alt=""><figcaption></figcaption></figure>

## Importing the web container template

{% stepper %}
{% step %}

### GTM web container

1. Go to **Admin** and click **Import Container**.
2. Click **Choose container file** and upload the JSON file for your web container.
3. Choose your **existing workspace**.
4. Select **Merge** and then **Rename conflicting tags, triggers and variables**.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FANcP3sboOjc0JILIvZ3e%2Fimage.png?alt=media&amp;token=b9df38ea-76a0-4236-b64f-802167f4bdef" alt=""><figcaption></figcaption></figure>

5. Go to **Variables** and edit every user-defined variable whose name starts with `@`. These are the constants that hold your the IDs for your platforms, and the `@` is there so you can spot them at a glance. Nothing works until they're filled in.
6. Check for a duplicate Google Tag. If you already had a Google Tag for the GA4 Measurement ID you're now configuring, delete or pause it. Your web container should only ever contain one Google Tag per endpoint (one per Google Ads ID, one per GA4 ID).
7. Pause or remove overlapping tags. You're now generating GA4 events based on the AdPage dataLayer, so any older tags function on the former e-commerce dataLayer need to be paused or removed.
   {% endstep %}

{% step %}

### GTM server container

1. Go to **Admin** and click **Import Container**.
2. Click **Choose container file** and upload the JSON file for your web container.
3. Choose your **existing workspace**.
4. Select **Merge** and then **Rename conflicting tags, triggers and variables**.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Ft1Ibnp88tTxO36oiDE86%2Fimage.png?alt=media&amp;token=05d5db20-4542-433e-883d-598098e0417b" alt=""><figcaption></figcaption></figure>

5. Go to **Clients** and check whether an extra GA4 client has been added. If it has, delete the new imported GA4 client.
6. Go to **Variables** and edit every user-defined variable whose name starts with `@`. These are the constants that hold your the IDs, Labels and Tokens for your platforms, and the `@` is there so you can spot them at a glance. Nothing works until they're filled in.
   {% endstep %}
   {% endstepper %}

These templates are the starting point of your tracking setup, not the finished product. If you publish your GTM containers straight after importing the JSON files, you will run into problems: unfilled variables, duplicate tags and events firing twice.

{% hint style="info" %}
Never ever publish a Google Tag Manager container after importing a template without validating using the Google Tag Manager preview mode.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/getting-started/using-adpage-templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
