Client-Side Tracking with Google Tag Manager

How does it work?

When a user clicks on one of your products on moebel.de, meubles.fr, meubelo.nl, moebel24.at, moebel24.ch, or mobi24.es, our server generates a unique clickID (moeclid) which is appended as a query parameter to your landingpage URL. With the integration of our client-side script, the clickID is written into the local storage for 90 days. Our server does not get any requests from you unless the user converts.

If the user makes a purchase on your site and has an existing moeclid value in the local storage of the browser, a conversion event is sent to our server including the clickID and further purchase-related data.

Prerequisites

Before you proceed with this integration, make sure the following conditions are met:

  • You have received your Partner ID or dedicated Sales Tracking Key.

  • You have set up a Google Tag Manager web container.

  • Your have configured UA/GA4 eCommerce tracking.

Integration

The client-side salestracking for Google Tag Manager consists of two tags - the base code tag and the conversion tag.

1. Base Code

The base code tag writes the appended moeclid parameter value of the landing page URL into the local storage of the browser. The trigger of this tag is configured in a way that the tag only fires if the user reached your site through one of our portals. It doesn’t affect your traffic from other marketing channels.

  1. Add a new tag and select “Custom HTML” as tag type

  2. Copy the code snippet of the initialization script and paste it. Please be aware that the script differs based on the given portal (moebel.de, meubles.fr, mobi24.es, etc.)

cfc8764f 52bc 4a4e a646 1cab4801dc26

Initialization Script per Portal

moebel.de Partners

<script src="https://www.moebel.de/partner/initialize.js"></script>

meubles.fr Partners

<script src="https://www.meubles.fr/partner/initialize.js"></script>

meubelo.nl Partners

<script src="https://www.meubelo.nl/partner/initialize.js"></script>

moebel24.at Partners

<script src="https://www.moebel24.at/partner/initialize.js"></script>

moebel24.ch Partners

<script src="https://www.moebel24.ch/partner/initialize.js"></script>

mobi24.es Partners

<script src="https://www.mobi24.es/partner/initialize.js"></script>
  1. Create a new “Page View” trigger where the URL of the page contains “moeclid=”. This way, the base code tag is only fired when a user reached your site through a moebel.de product click.

26beab09 b30a 4f8d a8da 4a9e32566446
  1. Add the trigger to the tag and save the tag.

Since local storage cannot be shared across domains/subdomains, saving the clickID (moeclid) to use at checkout will not work if the actual checkout page is on a different domain/subdomain than the product page the user was sent from us.

2. Conversion

The conversion tag enables sending us a purchase event at the time the user converts. If there is no clickID from the initialization script in the local storage of the browser, calling sales function will do nothing. Moreover, this script removes obsolete clickIDs (older than 90 days) from local storage.

  1. Add a new tag and select “Custom HTML” as tag type

  2. Copy the code snippet of the conversion script and paste it. Please be aware that the script differs based on the given portal (moebel.de, meubles.fr, mobi24.es, etc.)

21ff6680 32b7 4247 98f9 06ab70d5e9af

Conversion Script per Portal

moebel.de Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.moebel.de/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "EUR", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>

meubles.fr Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.meubles.fr/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "EUR", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>

meubelo.nl Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.meubelo.nl/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "EUR", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>

moebel24.at Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.moebel24.at/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "EUR", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>

moebel24.ch Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.moebel24.ch/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "CHF", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>

mobi24.es Partners

<script>
var st = document.createElement('script');
st.setAttribute('src', 'https://www.mobi24.es/partner/push.js');
st.setAttribute('data-partner-key', 'INSERT-YOUR-PARTNER-KEY');
st.setAttribute("onload", "sendSale()");
document.head.appendChild(st);
function sendSale()
{
  MOEBEL_SALES.sale({
  total: {{ecommerce.value}}, // Can be float or integer, required
  shipping: {{ecommerce.shipping}}, // Can be float or integer, required
  currency: "EUR", // Optional, default: EUR
  orderId: "{{ecommerce.transaction_id}}", // Optional
  items: {{ecommerce.items}} // Array of Items, required
 });
}
</script>
  1. Enter your partner key (provided by your account manager) in line 4

  2. Add all required variables in the sendSale() function. If you have UA/GA4 eCommerce tracking enabled, all required variables should already be set up with the “purchase” event.

A description of all parameters with example values you can find in the table below:

parameter description mandatory field data type example comment

total

gross total basket value, without shipping costs and tax

yes

float

1499.97

2 digits, "." as decimal delimiter, no thousand delimiters

shipping

shipping costs

yes

float

29.99

2 digits, "." as decimal delimiter, no thousand delimiters

items

array of unique items in order. elements:

- item_id (string), alternatively: id (string),

- quantity (integer),

- price (float),

- item_category (string) alternatively: category (string)

yes

array

[{ "item_id": "47886359", "quantity": "1", "price": "899.99", "item_category": "boxspringbetten" }, { "item_id": "31118801", "quantity": "2", "price": "299.99", "item_category": "heimtextilien" }]

currency

currency

yes

string

EUR

DIN norm

orderid

your identifier for the order

no

string

1172210481407

  1. Add the "purchase" event as trigger and save the tag

344f51e6 06c6 4a8f 9ad6 f17b9cdc8acb
  1. Publish your container version