> For the complete documentation index, see [llms.txt](https://addressable.gitbook.io/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://addressable.gitbook.io/knowledge-base/event-tracking/addressable-pixel/pixel-via-google-tag-manager-gtm.md).

# Pixel via Google Tag Manager (GTM)

This guide explains how to implement the Addressable Pixel using the Addressable Google Tag Manager template.

The Addressable Pixel is used to send website events to Addressable, such as page views, registrations, wallet connections, first-time deposits, deposits, purchases, or any other key funnel events agreed during the onboarding process.

## Prerequisites

Before starting, make sure you have:

1. Access to the relevant Google Tag Manager container.
2. Permission to create and publish GTM tags, triggers, and variables.
3. The GTM container installed on all relevant website pages.
4. The Addressable Pixel ID provided by your Addressable point of contact.
5. A clear list of the events that should be sent to Addressable.
6. Data layer events available for the actions you want to track, where relevant.

## Step 1: Add the Addressable Pixel Template in GTM

1. Open Google Tag Manager.
2. Select the relevant account and container.
3. Go to **Templates**.
4. Under **Tag Templates**, click **Search Gallery**.
5. Search for **Addressable Pixel**.
6. Select the Addressable Pixel template.
7. Click **Add to workspace**.
8. Approve the required template permissions.

Once added, the Addressable Pixel template will be available as a tag type when creating new tags.

## Step 2: Create an Addressable Pixel ID Variable

To avoid adding the Pixel ID manually in every tag, create a reusable variable.

1. Go to **Variables**.
2. Click **New** under **User-Defined Variables**.
3. Select **Constant** as the variable type.
4. Add the Addressable Pixel ID as the value.
5. Name the variable:

`Constant - Addressable Pixel ID`

6. Save the variable.

Use this variable in all Addressable tags.

## Step 3: Create the Addressable PageView Tag

The PageView tag should fire when a user loads a page on the website.

1. Go to **Tags**.
2. Click **New**.
3. Select the **Addressable Pixel** template.
4. Configure the tag:
   * Pixel ID: `{{Constant - Addressable Pixel ID}}`
   * Event name: `page_view`
   * Event type: PageView
5. Set the trigger to **All Pages**.
6. Name the tag:

`Addressable - PageView`

7. Save the tag.

## Step 4: Add SPA PageView Tracking, If Relevant

If the website is a Single Page Application, users may navigate between pages without a full page reload. In this case, the regular All Pages trigger may not capture all page changes.

For SPA websites:

1. Go to the existing **Addressable - PageView** tag.
2. Add an additional trigger:
   * Trigger type: **History Change**
   * Fire on: All History Changes, or only relevant page changes if filtering is needed.
3. Test carefully to make sure each virtual page view fires only once.

If duplicate PageViews appear, add a deduplication condition based on the current page URL and a short time window.

## Step 5: Create Addressable Event Tags

Create a separate Addressable tag for each event you want to track.

For each event:

1. Go to **Tags**.
2. Click **New**.
3. Select the **Addressable Pixel** template.
4. Configure the tag:
   * Pixel ID: `{{Constant - Addressable Pixel ID}}`
   * choose tracking mode:\
     \- PageView: for implementing the base code and the PageView event\
     \- Event tracking: for tracking any lower funnel event
   * choose event type:\
     \- Registration\
     \- First Time Deposit\
     \- Deposit\
     \- Custom (name it afterwords)
   * Additional properties: map any required event parameters
5. Add the relevant trigger.
6. Save the tag using a clear naming convention.

Example:

`Addressable - Signup Completed`

## Step 6: Add Event Parameters

Some events should include additional parameters to improve attribution, deduplication, and reporting quality.

Recommended parameters:

| Parameter              | Description                                       |
| ---------------------- | ------------------------------------------------- |
| user\_id               | Internal user ID, if available                    |
| transaction\_id        | Unique ID for revenue or transaction events       |
| transaction\_amountUSD | Transaction amount in USD                         |
| wallet\_address        | Wallet address, if available and approved to send |
| order\_id              | Order or trade ID, if relevant                    |

**For revenue events, send the amount as a numeric value in USD:**

Example:

```
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'deposit',
  user_id: '12345',
  transaction_id: 'dep_98765',
  transaction_amountUSD: 250,
});
```

## Step 7: Test the Implementation

Before publishing, test the setup in GTM Preview Mode.

For each event, confirm:

1. The correct Addressable tag fires.
2. The tag fires only once per action.
3. The Pixel ID is populated correctly.
4. The event name is correct.
5. Required parameters are populated correctly.
6. Revenue values are sent in the expected format.
7. No duplicate events are created.
8. SPA navigation sends PageView events correctly, if relevant.

You can also validate the requests in the browser Network tab by filtering for Addressable-related requests.

## Step 8: Publish the GTM Container

After testing is completed:

1. Click **Submit** in GTM.
2. Add a clear version name, for example:

`Addressable Pixel Implementation`

3. Add a short description of the changes.
4. Publish the container.

## Step 9: Final Validation with Addressable

After publishing, notify your Addressable point of contact and provide:

1. The landing pages URL.
2. The list of implemented events.
3. A short explanation of when each event fires.
4. Example test actions completed during QA.
5. Any known limitations or pending events.

Addressable will confirm whether the events are received correctly on their end.

*Note: If your platform has **Content Security Policy** (CSP), you will need to* [***configure our domains***](https://addressable.gitbook.io/knowledge-base/event-tracking/addressable-pixel/content-security-policy-csp) *as well — If you're unsure, we're happy to help.*


---

# 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://addressable.gitbook.io/knowledge-base/event-tracking/addressable-pixel/pixel-via-google-tag-manager-gtm.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.
