Server-Side Tracking with Google Tag Manager
| This integration requires a server container in Google Tag Manager ("server-side tagging") and cannot be used with a classic web container. If you do not use a server container, please follow the guideline for client-side integration 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, mobi24.es, mobi24.it, living24.pl or living24.uk, our server generates a unique clickID (moeclid) which is appended as a query parameter to your landing page URL. With the integration of our Custom Tag Template in your server container, the clickID is written into a corresponding first-party cookie called moeclid. The moeclid cookie is set by your tracking server as an HTTP cookie with an expiration of 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 cookie in their browser, a conversion event is sent to our server including the moeclid value and further purchase-related data.
| Please note that we are requesting unattributed sales data from you. As we utilize this data to promote your products through our algorithm, attributing sales to specific customers or sources may negatively impact the scoring of your products, leading to poorer performance. |
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 server-side tagging with Google Tag Manager and a configured web AND server container.
-
You have configured the following GA4 events in your web container, which are delivered to your server:
-
page_view -
purchase
-
-
Your server container is mapped to a custom subdomain.
-
You have told your account manager whether you report gross values (including tax) or net values, so that we can handle the tax correctly.
Integration
The server-side sales tracking for Google Tag Manager consists of two tags, the base code tag and the conversion tag, both created from our tag template.
First, download the tag template: moebel_salestracking.tpl
After that, go to Templates in your GTM server container and click on New in the Tag Templates section. Click on the three dots in the upper right corner and select Import.
Choose the downloaded template file and click Save. After that you can create the tags.
| Use the downloadable template linked above. The version in the Google Tag Manager Community Template Gallery is older: its portal dropdown does not offer all of our portals. |
1. Base Code
The base code tag enables setting the moeclid cookie which stores the moebel.de-specific clickID (moeclid). The trigger of the base code 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.
-
Add a new tag and select
moebel.de Salestrackingas tag type -
Choose
Base Codeas event type -
As URL Source, keep
page_location
-
Create a new
Page Viewtrigger for some page views where the variablepage_locationcontainsmoeclid=. If your container has no such variable yet, create anEvent Datavariable namedpage_locationwith the key pathpage_location. This way, the base code tag only fires if a user reached your site through a product click on one of our portals.
-
Add the trigger to the tag and save the tag
2. Conversion
The conversion tag enables sending us a purchase event at the time the user converts. The trigger for the conversion tag is configured in a way that only purchases with a moeclid cookie are transmitted to us. Besides the moeclid and your partner key the request is supposed to contain further event data which are explained in step 6.
-
Create a new variable of the type
Cookie Valuewith the cookie namemoeclidand name itmoeclid cookie. It provides the value for themoeclidproperty and for the trigger.
-
Add a new tag and select
moebel.de Salestrackingas tag type -
Choose
Conversionas event type -
Choose the portal where you want to send the request to (e.g. moebel.de, meubles.fr, meubelo.nl, mobi24.es, etc.). If you track several shops or portals in one container, see Several Shops or Markets.
-
Enter your partner key (provided by your account manager)
-
Add all required properties with the corresponding values to the JSON Request Body. For
moeclid, use themoeclid cookievariable; create all other values asEvent Datavariables from the incoming GA4purchaseevent. Use the Event Data key pathsvalue,shipping,itemsandcurrencyfor the matching properties, andtransaction_idfororder_id.
The table below describes the properties and provides example values:
| Parameter | Description | Mandatory Field | Data Type | Example | Comment |
|---|---|---|---|---|---|
moeclid |
unique clickout id from moebel.de (stored in the moeclid cookie) |
yes |
string |
0f81f6c0-bee9-420f-8f1f-e9f7f79f5424 |
|
value |
total basket value, without shipping costs, gross or net as agreed with your account manager |
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: - - - - |
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 of the amounts |
yes |
string |
EUR |
ISO 4217 code of the currency your amounts are in, e.g. EUR, CHF, PLN or GBP |
order_id |
your identifier for the order |
no |
string |
1172210481407 |
recommended, unique per order |
-
Create a new
Custom Eventtrigger with the event namepurchasewhere the variablemoeclid cookiedoes not equalundefined. This way, you only send requests for conversions from our portals.
-
Add the trigger to the tag and save the tag
-
Publish your container version
Several Shops or Markets
If you track several shops or several of our portals in one server container, the following sections show how each sale reaches the right portal with the right partner key.
| The Base Code tag stays as it is: one tag for all shops and portals, because it stores the clickID regardless of the portal the click came from. |
Several Shops in One Container
If your shops have different host names, two Lookup Tables choose the portal and the partner key for every sale from the host name.
1. Routing Variables
-
In your web container, open the Google tag that sends your events to the server container and add the configuration parameter
page_hostnamewith the value{{Page Hostname}}. -
In your server container, create a new variable of the type
Event Datawith the key pathpage_hostnameand name itED - page_hostname. -
Create a new variable of the type
Lookup Tableand name itLT - moebel.de - Portal. As input variable, selectED - page_hostname. -
Add one row per host name of your shops, as in the screenshot. As output, enter the endpoint URL of the portal your visitors come from; copy it from the table below the screenshot.
Portal Endpoint URL moebel.de
https://redirect.moebel.de/api/1.0/moebel/de/salesmeubles.fr
https://redirect.meubles.fr/api/1.0/moebel/fr/salesmeubelo.nl
https://redirect.meubelo.nl/api/1.0/moebel/nl/salesmoebel24.at
https://redirect.moebel24.at/api/1.0/moebel/at/salesmoebel24.ch
https://redirect.moebel24.ch/api/1.0/moebel/ch/salesmobi24.es
https://redirect.mobi24.es/api/1.0/moebel/es/salesmobi24.it
https://redirect.mobi24.it/api/1.0/moebel/it/salesliving24.pl
https://redirect.living24.pl/api/1.0/moebel/pl/salesliving24.uk
https://redirect.living24.uk/api/1.0/moebel/gb/sales -
Create a second
Lookup Tablevariable namedLT - moebel.de - Partner Keywith the same input variable and the same rows. Its output is the partner key you received for that portal.
Fill both tables with the same host names. A host name without a row returns undefined, and no sale from that shop reaches us. If a shop answers both with and without www., add a row for each.
|
2. Conversion Tag
In your Conversion tag, choose the variable LT - moebel.de - Portal in the portal dropdown and enter {{LT - moebel.de - Partner Key}} as partner key.
Then publish both containers: the web container, because of the new page_hostname parameter, and the server container.
Everything else stays as in the standard setup described under Conversion: the JSON Request Body with the moeclid cookie variable, and the purchase trigger.
|
One Shop for Several Markets
If one shop serves several of our portals under one host name, for example www.your-shop.com for moebel.de, moebel24.at and moebel24.ch, the host name cannot choose the portal. How to route the sales then depends on whether the URLs of the shop carry a country code.
With a Country Code in the URL
If your container already has a variable that tells the portals apart, for example a country code from the URL, use it as input variable of the two Lookup Tables from Routing Variables instead of ED - page_hostname, with one row per value.
Without a Country Code
If nothing in the URL tells the portals apart, send every sale to each of these portals.
-
Create one Conversion tag per portal, each with that portal in the dropdown and the partner key you received for it. Set up the JSON Request Body as in the standard setup.
-
Give all of them the
purchasetrigger from Conversion. -
Publish your container version.
| Each sale then reaches all of these portals. Our system assigns it to the partner account the click belongs to; in the other portals it is recorded as not assignable. |