Installation and getting started

Three examples: order, reservation and lead.

One script on your website is the foundation. Moving from a base pixel to a fully configured measurement takes a few steps. Below, each example shows what you use, what counts as a conversion, where the value comes from and how to verify the measurement.

These examples describe only behaviour Roots supports. There is no connection to reservation or booking systems; forms, buttons, the number pool and imports are the available routes.

You copy the script per site from your Roots account (Websites & pixel). Paste it just before the closing head tag, so click IDs are captured on the first page view.

<script async src="https://rootsmetrics.com/sr.js" data-key="JOUW_PIXELSLEUTEL"></script>

Shape of the script, with your own pixel key

On request, you can use your own tracking domain instead of rootsmetrics.com.

What the base pixel already measures

Once the script is in place, Roots measures without further setup:

  • Page views, with click IDs such as gclid, fbclid, ttclid and li_fat_id plus your campaign's utm parameters.
  • Submitted forms, as the form_submit event. Exclude a search or filter form with data-sr-ignore.
  • Clicks on tel: links as phone clicks and clicks on mailto: links as email clicks. That is a click, not a confirmed call or reply.
  • Clicks on buttons or links with the data-sr-event attribute; its value becomes the event name.
  • Orders on sites with a GA4 dataLayer or Shopify checkout: only the purchase event counts as a conversion, with duplicate orders deduplicated by order number.
  • No values yet: without extra configuration a conversion has no amount. Roots can only compare sources fairly once conversions carry a value.

What a fully configured measurement adds

From installed base pixel to configured measurement: this is what you set up in Roots.

  • Event names and amounts via data-sr-event, data-sr-value and data-sr-currency on buttons, links and forms, or via srAttribution.track(...).
  • Conversion types with fixed, estimated or dynamic values in Conversions & value, so every conversion gets a comparable value.
  • Connections to Google Ads, Meta Ads, LinkedIn Ads and TikTok Ads for spend, clicks and impressions, plus a GA4 connection for sessions and channels.
  • Server-side forwarding of conversions to Meta, Google Ads, LinkedIn and TikTok using a dataset or conversion ID and access token. LinkedIn requires an email address with the conversion; Google Ads requires a gclid or email address.
  • Orders from your shop server via the order webhook and conversions outside your website via CSV import or CRM webhook.

Three examples

How setup works per situation

Per example: which existing installation you use, which event counts, where the value comes from, which extra configuration is needed and how to verify the measurement.

Example 1 · E-commerce

A webshop order

Your shop runs on Shopify, WooCommerce, Magento or a custom shop. You want not only visitors but real orders with order value, per channel.

What you use
The Roots pixel in the head of your shop theme, following the platform guide on the integrations page. You get the pixel key and script from your Roots account (Websites & pixel).
What counts as a conversion
The purchase event at the moment the order is completed. On sites with a GA4 dataLayer or Shopify checkout, the pixel recognises this event itself.
Where the value comes from
The real order amount. On the thank-you page or order status page you send the amount with srAttribution.track:
Shopify: script on the order status page
<script>
  srAttribution.track("purchase", {
    value: {{ checkout.total_price | divided_by: 100.0 }},
    currency: "{{ shop.currency }}"
  });
</script>
Additional configuration
  • Set the type Webshop order to Dynamic in Conversions & value. If your platform sends no amount, configure a fixed fallback value.
  • Want orders from visitors with an ad blocker or an abandoned thank-you page included anyway? Let your shop also send every order from the server to the Roots order webhook (Shopify, WooCommerce, Magento). An order the pixel already reported is not counted twice.
  • Forwarding conversions to Meta, Google Ads, LinkedIn or TikTok? Under server-side forwarding, fill in the dataset or conversion ID and access token per platform. Every conversion carries a unique event ID, so the platform counts browser and server event as one conversion.
Verify that it works
  • Open your shop in a private window and place a test order.
  • Check in Websites & pixel that the steps Script placed, Events received, Conversions measured and Conversion value set turn green.
  • Check in Test your tracking that the purchase event with the correct amount appears in the event stream.

Example 2 · Restaurants

A restaurant reservation

Visitors book via a form or a booking button on your site. You want to know which channel generates requests, even without an amount in the form.

What you use
The Roots pixel in the head via the platform guide. The reservation form counts automatically as form_submit; data-sr-event="reservering" gives the form or button its own name.
What counts as a conversion
Submitting the reservation form, or the click on the button with data-sr-event="reservering".
A submitted form is a request, not a confirmed table. Roots measures the request as you configure it.
Where the value comes from
No amount in the form. The conversion type Reservation (hospitality) calculates an estimate: covers × average spend, weighted across lunch and dinner.
Example: your own event name on the form
<form data-sr-event="reservering"> ... </form>
Additional configuration
  • In Conversions & value, set your average lunch and dinner spend and the share of dinner in the total.
  • Roots has no connection to reservation or booking systems. Want only placed reservations counted? Then do not measure the form; add confirmed reservations via CSV import or the CRM webhook, with external_id to prevent double counting against pixel events.
  • Reservations arriving by phone are added the same way; Roots attaches them to that visitor's first known visit.
Verify that it works
  • Open your site in a private window and submit a test reservation.
  • Check in Test your tracking which event name arrives and whether the form is not excluded with data-sr-ignore.
  • Check in Conversions & value that the Reservation (hospitality) type has the right calculation rule.

Example 3 · B2B or services

A qualified lead

Visitors request a quote or demo through a form. You want to attribute requests and later closed deals to the right channel without presenting the request as a qualified lead.

What you use
The Roots pixel in the head via the platform guide. The form counts automatically as form_submit; data-sr-event="offerte_aanvraag" lets you choose your own event name.
What counts as a conversion
The form submission as a lead request. Whether a lead is qualified is decided in your CRM; Roots does not judge that.
A click on a tel: link is a phone click, not a confirmed call. With the number pool (data-sr-phone) and your phone system's webhook, an answered call with duration counts.
Where the value comes from
No amount in the form. The conversion type Form / quote calculates: average deal value × close rate, so requests stay fairly comparable with orders.
Example: event name and email address
<form data-sr-event="offerte_aanvraag" data-sr-email="{{ your email field }}"> ... </form>
Additional configuration
  • In Conversions & value, set the average deal value and close rate.
  • Want the request in your CRM with its conversion source? Set HubSpot as a destination or use your own webhook with a filter on the event name.
  • Send closed deals back with CSV import or the CRM webhook, using visitor_id or external_id; Roots attaches them to the first known visit. Up to 5,000 rows per import.
  • Forwarding conversions to LinkedIn? An email address with the conversion is required; pass it with data-sr-email or through your own integration.
Verify that it works
  • Submit a test form in a private window and check the event name in Test your tracking.
  • Check that the form is not excluded with data-sr-ignore and that the right conversion type determines the value.
  • When forwarding server-side to Meta or TikTok, enable the test code so you can verify delivery in that platform's Events Manager.

Getting started

The order of steps in your Roots account

  1. 1Add your website and paste the script just before the closing head tag, with no tag manager in between.
  2. 2Check in Websites & pixel that Script placed and Events received turn green.
  3. 3In Conversions & value, give each event the right name and value.
  4. 4Connect your advertising accounts for spend, clicks and impressions.
  5. 5Optionally enable server-side forwarding, the order webhook or offline import.

Every step also lives in your Roots account, under Websites & pixel, Conversions & value and Test your tracking. This overview describes behaviour that exists in the product; settings and platform requirements can differ per environment.