With Google Server Side Tagging you can run your own server that sends trackrequests to Mapp Trackservers. There are two major goals that can be accomplished with that kind of setup:

  1. Completely avoid tracking on the client side (e.g. in the browser) by sending all requests right from your app server to the GTM server.
  2. Sum up several client-side requests for different providers to one single request to the GTM server, which then splits up the data and sends different requests to different providers on the server side.

To better understand the infrastructure, we recommend reading through Google's documentation here.

In general, there are two parts when it comes to server-side tagging: Client Templates and Tag Templates. Mapp provides a Tag Template, while the Client Template must be composed based on your individual needs.


Even though the Client Template has "Client" in its name, it also runs on the GTM Server, not in the client browser.


You can set up as many Client Templates as you want, however, only one Client Template can be used for one incoming request. You set up certain conditions, like a query parameter that must be in the incoming request, and when the condition(s) is(are) met, the Client Template "claims" the request. It then reads all the data that comes from the request and transforms it into "event data". Those are basically just plain JavaScript objects that are made available to the Tag Template.


The Tag Template then needs to be configured as expected from the client side GTM: you can define variables that hold data from your events. Then, those variables can be mapped to different entities like the page name, event name, parameters, categories, and device information. You must also configure it by entering a track domain and track ID. Then, the Mapp Intelligence tag template will send a trackrequest with all the data you mapped to the given trackserver.

Set up In GTM

  1. In your account, create a new container. Under Target Platform select Server.
  2. In your Workspace, navigate to Tags and click on New in the upper right corner.

  3. Until our template has been accepted by Google, please download the template.tpl file here. Then you can upload it to GTM. Once we are accepted, you will be able to go to the TagConfiguration field, click on edit, and search for "Mapp Intelligence". The template should appear under more.

Besides your new container, you will need to have a tagging server. If yours is not already set up, Google has a guide here.

Configuration

Mandatory config

There are two mandatory settings, no trackrequest can be sent if one of the fields is empty. Everything else is optional.

  1. track domain
  2. track ID

Referrer

This should be the value that is available in browsers under document.referrer.

Domains excluded from the referrer

List of domains that should be treated as internal referrers (for example your page domain and payment providers). Do not include http or https.
Map this field to a semicolon-separated list of domains, for example:
"abc.com;my-domain.de;paypal.com"
You can also map this field to an array of strings:
[ "abc.com", "my-domain.de" , "paypal.com" ]

Debug mode

If the debug mode checkbox is selected, the trackrequest will be logged to the console before being sent to the trackserver. It should only be enabled during development and deactivated in production.

Device

IP Address / User Agent

In the Device section, you can map various device information. One of the most important mappings is the IP address. It should be the IP address of the end user, not the application server. This will help, in combination with the User Agent, to hold the session together when no EID is available. Therefore, we highly recommend mapping those two fields. If they are not mapped, or the mapped value is false, the tag will look for the event properties ip_override and user_agent to get this data. Those names are used in the GA4 tag.

Client Hints

Chromium-based browsers stopped using User Agents and switched to Client Hints instead. Read more about this here.

You can either map the original strings from the client hint headers, or you can use the format that is given by the GA4 GTM tag. That means that sec-ch-ua and sec-ch-ua-full-version-list can be mapped to an array of objects with brand and version properties, and sec-ch-ua-mobile can be mapped to a boolean value.

More device data

The expected data for the other fields is available in browsers only, so if you have a pure server-to-server setup, it won't be possible to track those. For example, if no x or y values for display size are mapped, the tag tries to read the event property screen_resolution provided by the GA4 GTM tag.

Page

In the Page section, you can map the page name (also known as content ID), page URL, page parameter, and page categories. If no page name is given via mapping, the tag tries to read the event property page_location provided by the GA4 GTM tag, for example. If this is not available, no page name will be used.


Same for Page URL: if no value is mapped here, the tag tries to read event property page_location. If this is not found, no value will be given here.

We suggest cutting query parameters from the page name but including them in the page URL. The page URL, which results in the pu parameter of the trackrequest, is used for reading media campaigns. So, make sure that the query parameters of your campaigns are included under the page URL. However, you might not want them in your page name since different query parameters for different campaigns refer to the same page and therefore should have one and the same page name.

Session

In the Session section, you can map the session parameter and a temporary session ID. Use the latter to hold the session together yourself in case your application has any kind of session ID. The GA4 tag also provides a session ID that can be mapped here.

E-commerce

The E-commerce section is used to map all kinds of e-commerce data. While e-commerce parameter mappings, currency, order ID, and order value are straightforward, product mappings leave you with a choice: you can either map strings that are formatted as they are expected by Mapp's trackserver - that means data for several products are separated by a semicolon. So if you have two products during an order event, the string for the product name can be ProductA; ProductB.


Keep in mind that the product status is a single value that counts for all products and can be view, add, conf, or list.  Most of the time you'll have arrays of product objects in your event data though. In this case, it makes sense to activate the Track Product Data from the Array checkbox. You can map the product array and enter the names of the keys in the product objects in the corresponding mapping fields. For example, if the product id can be found under item_id, as is the case for Google's default e-commerce tracking, you just enter "item_id" in the mapping field for product id.

User

Under User, you can map user data, like URM parameter and a custom visitor ID (cd parameter in the trackrequest).

EID

The EID, also known as "Ever ID", is used to recognize users anonymously. In the EID section, you can define the EID handling.


If you map No Cookie to boolean true, the eid parameter will be omitted in the trackrequest, and the parameter nc=1 will be sent to tell the trackserver that no cookies are allowed by this particular user.


If you have your own anonymous ID, you can map it to Ever ID (EID). The tag will set no cookie then and use your value as the EID value (which will be transformed to a proper EID by the trackserver, so you won't find your exact EID value in the data, except it already is a 19-digit number).


If the user allows cookies and you don't set your own EID, the tag will generate an EID, save it in a cookie, or read from the cookie if it already exists. Under the EID Cookie Name, you can define a name for that cookie. By default, the Smartpixel cookie is used. Use Cookie Options to configure how the cookie is set.


Important: The Server Side Tag needs to run in a subdomain of your application because only then the EID cookie is considered a first-party cookie. If the Tag runs in another domain, the cookie is considered a third-party cookie and will be blocked by many browsers.

Campaign

Here, you can map campaign parameters and campaign IDs. The campaign ID is sent to the trackserver via the mc parameter and needs to be encoded. An example value could be wt_mc%3Den.internal.newsletter.2017.05. Please note the double-encoding of the equal sign in the request. However, if you already map the page URL in the page section with all query parameters, then you don't need to map anything here.

Event

In the event section, you can map the event parameter and the event name.


Mapp Github