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.
2. Report events
When a visitor adds an item to the cart, callmeasure with items_added. This event is required. The snippet from step 1 must be on that page too.
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.
3. Add user data (recommended)
Hashed email and phone let Lemrock match a sale when the visitor comes back on another device or browser. Add them toinit, hashed (see Hash email and phone):
- User data lasts one page. Send it on every page where you know the visitor, before the
measurecall. If you only learn who the visitor is later, for example after login, callinitagain with just theuser. - A new
userreplaces 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.
4. Set up consent
The pixel assumes consent until told otherwise. If your site asks visitors for consent, pass the answer:- Pass
trueorfalse, not a string. Anything other thantruecounts 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.
5. Check your setup
Adddebug: true to init, then follow Check your setup. Remove it once the test is done.
