Skip to main content
Install the Lemrock Pixel in your site’s code. You need your pixel ID (lr_px_ followed by 22 characters), from your Lemrock contact.

1. Load the pixel

Paste this into the <head> of your page template, so it runs on every page. Replace lr_px_... with your pixel ID.
The script loads in the background and doesn’t slow your page.

2. Report events

When a visitor adds an item to the cart, call measure with items_added. This event is required. The snippet from step 1 must be on that page too.
Amounts are in cents: 2599 for €25.99. Here, amount is the price × the quantity added. For the recommended events, make the same call when they happen, with their name: order_created, checkout_started or contents_viewed. The amount and items to send for each are in Event fields. For order_created, call it on your order confirmation page and add your order number as a fourth argument: { event_id: "12345" }. It must be a string. See event_id. Hashed email and phone let Lemrock match a sale when the visitor comes back on another device or browser. Add them to init, hashed (see Hash email and phone):
  • User data lasts one page. Send it on every page where you know the visitor, before the measure call. If you only learn who the visitor is later, for example after login, call init again with just the user.
  • A new user replaces the previous one. Send both identifiers together if you have both.
  • Only send it for visitors whose consent covers sharing their email or phone with Lemrock for ad measurement.
The pixel assumes consent until told otherwise. If your site asks visitors for consent, pass the answer:
  • Pass true or false, not a string. Anything other than true counts as a refusal, including "true".
  • The refusal is remembered, so you don’t need to repeat the call on every page.
  • If your consent banner blocks scripts until the visitor answers, block the Lemrock snippet too.
To declare Lemrock in your cookie banner, see Consent (CMP).

5. Check your setup

Add debug: true to init, then follow Check your setup. Remove it once the test is done.