> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lemrock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversion tracking with Google Tag Manager

> Install the Lemrock Pixel with Google Tag Manager, no code on your site.

The Lemrock Pixel shows which Lemrock ads lead to sales on your site, so Lemrock can report your results and deliver more toward buyers. With Google Tag Manager (GTM), the install is configuration only: no code on your site.

You need your **pixel ID**. It looks like `lr_px_` followed by 22 characters. Your Lemrock contact gives it to you.

## The four events

Lemrock tracks four events. Send all four.

| Event | When it happens |
| - | - |
| Order created | a visitor places an order |
| Checkout started | a visitor starts checkout |
| Items added | a visitor adds an item to the cart |
| Contents viewed | a visitor views a product |

## 1. Import the template

1. Download the template: [gtm-template.tpl](https://drive.google.com/uc?export=download\&id=1kJQ_nJqka_53_8xesmqb6a7KBtljR4Da).
2. In GTM, go to **Templates > Tag Templates > New**.
3. Open the overflow menu (⋮), choose **Import**, pick the file and save.

## 2. Load the pixel on every page

Create a tag:

| Field | Value |
| - | - |
| Tag type | Lemrock Pixel |
| Pixel ID | your pixel ID |
| Send a measurement event when this tag fires | **unchecked** (checked by default) |
| Triggers | All Pages, **and** the event your consent tool sends when consent updates |

The second trigger matters: without it, a visitor who accepts cookies after landing loses their ad click.

## 3. Add one tag per event

Create one Lemrock Pixel tag per event. For an order:

| Field | Value |
| - | - |
| Tag type | Lemrock Pixel |
| Pixel ID | your pixel ID |
| Send a measurement event when this tag fires | checked |
| Event | Order created |
| Event ID | your order number |
| Amount format | Currency units or Cents (see below) |
| Amount | the order total |
| Currency | the currency code, such as `EUR`. Required with Amount |
| Contents | one row per item, with the same product IDs as your catalog feed |
| Trigger | the moment the order is completed |

Repeat for the other three events, changing **Event** and the trigger. Then publish the container.

* **Fill the fields from your [data layer](https://developers.google.com/tag-platform/tag-manager/datalayer)** with [Data Layer Variables](https://support.google.com/tagmanager/answer/7683362). If your data layer lacks the order number, total or currency, add them.
* **Event ID** makes an order count once, even if it's reported twice. Use the order number.
* **Amount format** applies to Amount and to each Contents amount:
  * **Currency units** (default): `25.99` for €25.99, as most data layers hold prices. Use a dot, not a comma.
  * **Cents**: `2599` for €25.99.
  * An amount that doesn't match the format sends nothing and prints a console warning. For currencies without cents, such as JPY, choose Cents and enter the price as is.

## 4. Add user data (recommended)

Hashed email and phone let Lemrock match a sale when the visitor comes back on another device or browser.

Open the **User data** section of your Lemrock tags and fill **Email SHA-256** and **Phone SHA-256**, usually from Data Layer Variables. Leave a field blank if you don't have the value.

Send hashes only, never the raw values. Lemrock refuses anything that isn't a SHA-256 hash.

1. Normalize:
   * **Email**: trim spaces, lowercase. `Jane.Doe@Example.com` → `jane.doe@example.com`.
   * **Phone**: digits only, starting with the country code, no `+` or leading zeroes. `+33 6 12 34 56 78` → `33612345678`.
2. Hash with SHA-256 and send 64 lowercase hex characters. `jane.doe@example.com` → `86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d`.

## 5. Set up consent

The template has no consent field. Set consent on all Lemrock tags at once: in **Tags**, tick every Lemrock tag, click the consent (shield) icon, and require:

* `ad_storage`, always.
* `ad_user_data` too, if you send user data (step 4).

## 6. Check your setup

1. **Open GTM Preview.** Debug mode turns on automatically. Pixel messages start with `[Lemrock Pixel]` in the browser console.

2. **Simulate an ad click.** Start Preview on any page with `?lrclid=lr_clk_0000000000000000000000` added, then accept your cookie banner. The console confirms the click token is stored.

3. **Send a test event** from the console. It's checked but not recorded:

   ```js theme={null}
   lemrock(
     "measure",
     "order_created",
     { type: "contents" },
     { event_id: "test-1", validate_only: true },
   );
   ```

   You should see `order_created test-1 sent (validate_only) → 202`.

4. **Place a test order** and check the same line appears without `(validate_only)`.

If something is wrong:

* **Read the console.** Setup mistakes always print a warning, even outside Preview.
* **Make sure your redirects keep `lrclid`** in the URL.

Your Lemrock contact can confirm events are arriving. Send them your pixel ID and the time of your test.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.