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:

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

  2. You have set up server-side tagging with Google Tag Manager and a configured web AND server container.

  3. You have configured the following GA4 events in your web container, which are delivered to your server:

    1. page_view

    2. purchase

  4. Your server container is mapped to a custom subdomain.

  5. 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.

189cdb86 dfc8 4f88 af2a e0fbbebb6f10

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.

  1. Add a new tag and select moebel.de Salestracking as tag type

  2. Choose Base Code as event type

  3. As URL Source, keep page_location

    4e876a1c dcd9 4844 83cb 1a45f309efdc
  4. Create a new Page View trigger for some page views where the variable page_location contains moeclid=. If your container has no such variable yet, create an Event Data variable named page_location with the key path page_location. This way, the base code tag only fires if a user reached your site through a product click on one of our portals.

    55d75ffd feac 495d b3fe e2224bcd329d
  5. 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.

  1. Create a new variable of the type Cookie Value with the cookie name moeclid and name it moeclid cookie. It provides the value for the moeclid property and for the trigger.

    5b58c9a2 6e7d 4fed 868f ad5838a64d99
  2. Add a new tag and select moebel.de Salestracking as tag type

  3. Choose Conversion as event type

  4. 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.

  5. Enter your partner key (provided by your account manager)

    a741816d 2e2d 4605 9188 58e3308b11bc
  6. Add all required properties with the corresponding values to the JSON Request Body. For moeclid, use the moeclid cookie variable; create all other values as Event Data variables from the incoming GA4 purchase event. Use the Event Data key paths value, shipping, items and currency for the matching properties, and transaction_id for order_id.

    084e9dde 833d 477b 94ff d0bc59057ee6

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:

- item_id (string),

- quantity (integer),

- price (float),

- item_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 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

  1. Create a new Custom Event trigger with the event name purchase where the variable moeclid cookie does not equal undefined. This way, you only send requests for conversions from our portals.

    77d9e313 cded 45b7 8636 5127924ba294
  2. Add the trigger to the tag and save the tag

  3. 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

  1. In your web container, open the Google tag that sends your events to the server container and add the configuration parameter page_hostname with the value {{Page Hostname}}.

  2. In your server container, create a new variable of the type Event Data with the key path page_hostname and name it ED - page_hostname.

  3. Create a new variable of the type Lookup Table and name it LT - moebel.de - Portal. As input variable, select ED - page_hostname.

  4. 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.

    1d90bb9e 50d4 4c26 bb49 868d56858c97
    Portal Endpoint URL

    moebel.de

    https://redirect.moebel.de/api/1.0/moebel/de/sales

    meubles.fr

    https://redirect.meubles.fr/api/1.0/moebel/fr/sales

    meubelo.nl

    https://redirect.meubelo.nl/api/1.0/moebel/nl/sales

    moebel24.at

    https://redirect.moebel24.at/api/1.0/moebel/at/sales

    moebel24.ch

    https://redirect.moebel24.ch/api/1.0/moebel/ch/sales

    mobi24.es

    https://redirect.mobi24.es/api/1.0/moebel/es/sales

    mobi24.it

    https://redirect.mobi24.it/api/1.0/moebel/it/sales

    living24.pl

    https://redirect.living24.pl/api/1.0/moebel/pl/sales

    living24.uk

    https://redirect.living24.uk/api/1.0/moebel/gb/sales
  5. Create a second Lookup Table variable named LT - moebel.de - Partner Key with the same input variable and the same rows. Its output is the partner key you received for that portal.

    426293e4 b04a 4d26 9fd5 69c542a6a89a
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.

5d298713 27d1 4e8b 92ff 9d8351a3937d

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.

  1. 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.

  2. Give all of them the purchase trigger from Conversion.

  3. 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.