# Implement Appier Tracking Code via GTM

{% hint style="info" %}
Before you begin, make sure you have your **GTM Container ID** (GTM-XXXXXXXX) and the **Appier tracking code snippets** provided by Appier.
{% endhint %}

{% tabs %}
{% tab title="ON THIS PAGE" %}

* GTM workspace overview
* Tag #1 — Analytic Tag (All Pages)
* Tag #2 — Landing Tag (Target Landing Page)
* Tag #3 — Process / Conversion Tag (Button Click or Thank You Page)
* Submit and verify
  {% endtab %}
  {% endtabs %}

### GTM workspace overview

When you log in to **tagmanager.google.com**, you will land on the **Default Workspace** overview. The key areas you will use throughout this guide are shown below.

<figure><img src="/files/vojEpVtBdIoX0AZ7zKD6" alt=""><figcaption></figcaption></figure>

Functional Bar:

1. `Overview` - Home page showing container status, workspace changes, and the live version.
2. `Tags` - Where you create and manage all tracking code snippets, including Appier's.
3. `Triggers` - Define the rules (which pages, which clicks) that fire your tags.
4. `Variables` - Reusable values — commonly used in e-commerce or dynamic URL matching.

***

### Tag #1 — Analytic Tag (All Pages)

> Fires on all pages · used for audience building and retargeting

The Analytic Tag is the base pixel. It must be present on every page of your website so Appier can build audience segments.

{% stepper %}
{% step %}

#### Go to Tags → New

In the left sidebar, click **Tags**, then click the **New** button in the top-right corner.

<figure><img src="/files/MZzOZ9RvgBoNnASQ0TIz" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Name the tag

Click the untitled field at the top and enter a clear name, e.g. `Appier - Analytic Tag`.

<figure><img src="/files/1RSFIE9RAJBOvpDmFC9Z" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Select tag type: Custom HTML

Under **Tag Configuration**, click the pencil icon → choose **Custom HTML** from the tag type list.

<figure><img src="/files/7d4EEks1P0W4epmmsQ5b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Paste the Appier tracking code

Copy the Analytic tracking snippet provided by Appier and paste it into the HTML field.

<figure><img src="/files/iA056oIMGH4Ixc6N9NWY" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Set triggering → All Pages

Under **Triggering**, click the pencil icon → select **All Pages** (built-in trigger). This fires the tag on every page load.

<figure><img src="/files/6vEiLlEDdNYqSrhPSeTI" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Save

Click **Save** in the top-right corner of the tag editor.

<figure><img src="/files/8DkV28QGkQYdyVgSZNfJ" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Tag #2 — Landing Tag (Target Landing Page)

> Fires on a specific landing page URL · used for campaign attribution

The Landing Tag fires only on your designated campaign landing page. You will create a custom trigger that matches the page URL.

{% stepper %}
{% step %}

#### Create the trigger first

Go to **Triggers → New**. Name it `Appier - Landing Page Trigger`.

<figure><img src="/files/96PS0bEZEOPKSuf7kR3d" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Kb9vWp0SwPF01p38eZri" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Choose trigger type: Page View

Click the pencil icon under Trigger Configuration → select **Page View**.

<figure><img src="/files/5yvkeKhPV0Fvyxccd0lX" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Set the condition to match your landing page

Select **Some Page Views**, then configure the filter:

* **Variable**  — e.g. `{{Page Path}}`&#x20;
* **Operator** — e.g. `contains`&#x20;
* **Value** — Enter your landing page path, e.g. `/html/index.html`&#x20;

{% hint style="info" icon="circle-t" %}
Tips: You can use the **Preview mode** to check **which** **variable** is useful for setting the trigger points (e.g. Page Path, Page URL, Click Test, etc.).

<img src="/files/Amk8pXZVNRtIzPVrCf0Z" alt="" data-size="original">&#x20;

When you land on your **landing page**:

<img src="/files/KeEzywiFAa8syktkI8oV" alt="" data-size="original">

Check the Tag Assistant: in this case, **page path** is a good tigger point!

<img src="/files/3XpjKYQXZsvE2BHGYMcD" alt="" data-size="original">
{% endhint %}

<figure><img src="/files/ZNrf0Ro5s5NevapoYa1A" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Save the trigger, then create the tag

Go to **Tags → New**, name it `Appier - Landing Tag`, select **Custom HTML**, and paste the Landing tracking snippet.

<figure><img src="/files/Lkp9LFOe0RspkuJ3c00z" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Assign the trigger

Under Triggering, select **Appier - Landing Page Trigger** (the one you just created).

<figure><img src="/files/JtMAaN8i36aQYJaFigrt" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Save

Click **Save** in the top-right corner of the tag editor.

<figure><img src="/files/GFPC0IwErYU7KNw5qysq" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Tag #3 — Process / Conversion Tag (Button Click or Thank You Page)

> Fires on button click or thank-you page · measures LeadGen conversions

The Conversion Tag records a completed action — either a button click (e.g. "Submit Form") or a visit to a thank-you page. Choose the method that matches your website setup.

#### <mark style="background-color:yellow;">Option A — Button click trigger</mark>

{% stepper %}
{% step %}

#### Enable click variable in GTM

Go to **Variables → Configure**. Enable **Click Elements** required (e.g. **Click Text** and **Click ID**.)

<figure><img src="/files/yRjvM3Snq3oc35NUl1c3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create a new trigger: All Elements (Click)

Go to **Triggers → New**. Name it `Appier - Conversion Button Click`. Choose trigger type **Click → All Elements**. Select **Some Clicks** and set:

* **Variable**  — e.g. `{{Click Text}}`&#x20;
* **Operator** — e.g. `contains`&#x20;
* **Value** — Enter your button text name, e.g. `login`&#x20;

{% hint style="info" icon="circle-t" %}
Tips: You can use the **Preview mode** to check **which** **variable** is useful for setting the trigger points (e.g. Page Path, Page URL, Click Test, etc.).

<img src="/files/Amk8pXZVNRtIzPVrCf0Z" alt="" data-size="original">&#x20;

**Click the button** you want to track:

<img src="/files/ZtBzzj4rEj8lEGodxybF" alt="" data-size="original">

Check the Tag Assistant: in this case, **click text** is a good tigger point!

<img src="/files/YbsUYj1YYQyOIIGkw0fr" alt="" data-size="original">
{% endhint %}

<figure><img src="/files/3l91D7JAdsWjpnHr81Zw" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the tag and assign the trigger

Go to **Tags → New**, name it `Appier - Conversion Tag (Click)`, select Custom HTML, paste the conversion snippet from code doc, then assign the trigger above.

<figure><img src="/files/poU0wtHXHA4Wo796qvmn" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

#### <mark style="background-color:yellow;">Option B — Thank-you Page trigger</mark>

{% stepper %}
{% step %}

#### Create a new trigger: Page View

Go to **Triggers → New**. Name it `Appier - Thank You Page Trigger`. Choose trigger type **Page View**, then select **Some Page Views**.

* **Variable**  — e.g. `{{Page Path}}`&#x20;
* **Operator** — e.g. `contains`&#x20;
* **Value** — Enter your thank-you page path, e.g. `/html/thanks.html`&#x20;

{% hint style="info" icon="circle-t" %}
Tips: You can use the **Preview mode** to check **which** **variable** is useful for setting the trigger points (e.g. Page Path, Page URL, Click Test, etc.).

<img src="/files/Amk8pXZVNRtIzPVrCf0Z" alt="" data-size="original">&#x20;

When you land on your **thank-you page**:

<img src="/files/nDAc5zKzIzyiXs62I8jQ" alt="" data-size="original">

Check the Tag Assistant: in this case, **page path** is a good tigger point!

<img src="/files/Osmokb8zTx24gTdCu2lM" alt="" data-size="original">
{% endhint %}

<figure><img src="/files/Sug0SgLMghWDjkCcx7Ke" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Create the tag and assign the trigger

Go to **Tags → New**, name it `Appier - Conversion Tag (Thank You)`, select Custom HTML, paste the conversion snippet, then assign this trigger. Save.

<figure><img src="/files/uu4QplL1XwS57R9RJjhX" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Only implement **one** of the two triggers above **per conversion event**. If both exist for the same action, the tag will fire twice and inflate your conversion count.
{% endhint %}

### Submit and verify

Once all the tags are configured, publish your changes and verify the tags are firing correctly.

{% stepper %}
{% step %}

#### Preview before publishing

Click **Preview** in the top-right of GTM. Enter your website URL and interact with the page to confirm each tag fires at the correct moment in the Tag Assistant panel.

<figure><img src="/files/Amk8pXZVNRtIzPVrCf0Z" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Check the Tag Assistant

**Walk through each trigger point** to confirm that every tag fires exactly when and where it should.

You can check the "Summary" part of the Tag Assistant for the overview:

<figure><img src="/files/7Ri4vDRmrLSuDNwvlnph" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Important — Expected firing behavior::

* `Appier - Analytic Tag` should fire on **every page** of the website.
* `Appier - Landing Tag` should only fire on the **designated landing page URL**.
* `Appier - Conversion Tag (Click)` should only fire when the **target button is clicked**.
* `Appier - Conversion Tag (Thank You)` should only fire when a user **lands on the thank-you page**.
  {% endhint %}
  {% endstep %}

{% step %}

#### Submit the container

Click **Submit** → add a version name (e.g. `Appier tags v1`) → click **Publish**. GTM will create a new version and go live.

<figure><img src="/files/qNBHTgRtRlrvRiEDDJrW" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: 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:

```
GET https://docs.adcloud.appier.com/implement-appier-tracking-code-via-gtm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
