← All resources Product

The Measurebase data tag and data client

Every event your website sends to a server container has to travel from the visitor's browser to your tagging server first. Usually the Google tag carries it, as a GA4 request. The Measurebase data tag is a second way to make that trip: a Tag Manager template for your web container that sends each event to its partner, the Measurebase data client in your server container, as one masked request.

This article explains what the two templates do, how they differ from the Google tag, when to choose them and how to set them up.

Why a second route

A GA4 request is easy to recognize. Its path is always the same, its parameter names are public and the event data in it is readable: the event name, the order value, the products. Ad blockers and privacy extensions work from lists of exactly those patterns, so a share of your visitors' events never leaves the browser, even when your tagging server runs on your own domain.

The data tag sends the same information in a form those lists have nothing to match on:

Masking is not encryption. The method is part of the template, so anyone who reads it can unmask a request. It keeps your events out of reach of pattern lists; the hashing is what protects personal data.

What arrives in your server container

The data client claims the data tag's requests, unmasks them and turns each one into the same event data the GA4 client produces: event name, event ID, client ID, page, the ecommerce fields, consent state and user data. Your server tags need no special setup to use it. GA4, Google Ads, Meta, TikTok, Microsoft Ads, LinkedIn, Pinterest and Snapchat tags fire on these events the way they fire on GA4 events, and the Measurebase power-ups (Profit Tracking, Click ID Restorer, Cookie Keeper, Bot Detection and the others) work on them too.

User data always arrives under user_data, in the schema Google's and the other platforms' tags read, never as loose event parameters. That keeps hashed customer data from ending up in GA4 as event parameters.

In your Measurebase dashboard these events count the same as GA4 events. Where the dashboard would say "GA4", it says "Event" for a domain whose events arrive through the data client.

Three ways to send events

The template builder in your dashboard asks how events should reach your server container:

The data tag uses the Google tag's visitor ID when the _ga cookie exists. Without it, it keeps its own first-party cookie, _mbcid, for two years, and a session cookie, _mbcid_s, that starts a new session after 30 minutes without events, like GA4.

It follows Consent Mode, with these settings on by default:

Your consent banner keeps deciding what is allowed. The data tag adds no new kind of data; it only changes how the data travels.

1Build the import

In your Measurebase dashboard, open GTM templates, fill in your tagging server address and choose Measurebase data tag (masked) or Both, per event as the way events travel. The builder writes a web container import and a server container import with the templates, the tags, the triggers and the per-site path already filled in. If you only want the templates themselves, download the data tag and the data client under Downloads.

2Import the web container

In your web container, go to Admin, Import container, pick the web file and merge it into a new workspace. Each GA4 event tag the builder would have made is a data tag here, with the same trigger and the same parameters. With the data tag as the only route, the Google tag is not part of the import.

3Import the server container

Do the same in your server container with the server file. It adds the data client next to the GA4 client and points your server tags at both through one trigger. Keep the GA4 client: the server-side purchase backup of the Measurebase plugins for WordPress and Shopware still arrives as a GA4 request, and so do Google tag events when you use both routes.

4Check it before you publish

Open preview mode in both containers and click through your site. In the server container's preview, requests from the data tag show the data client as their client, and your server tags fire on the events. Then publish both containers. The Tag Manager tab on your domain page in Measurebase checks the setup on its next audit: that every data tag sends to your own tagging server, that its path and parameter match the data client's, and that the server container has a data client at all. Each problem it finds comes with a fix you can apply.

Good to know

Frequently asked questions

Does the data tag replace GA4?

No. It replaces the browser's route to your server container, not GA4 itself. Your GA4 tag in the server container sends the events on to GA4 as before.

Can I use the data tag and the Google tag together?

Yes. Choose "Both, per event" in the template builder and pick a route for each event. Each event takes one route, and the data tag shares the Google tag's session, so GA4 sees one visit.

Do my Meta, TikTok and Google Ads tags need changes?

No. The data client produces the event data those tags already read. Tags built with the Measurebase template builder fire on both clients through one trigger.

Is the masked data encrypted?

No. Masking hides the event from pattern lists, but the method is in the template. Personal data such as email and phone is protected by SHA-256 hashing in the browser before it is sent.

Does deduplication with server-side purchases still work?

Yes. The browser purchase carries the order number as transaction ID and event ID through either route, so GA4 and the ad platforms can match it with the server-side copy.

Why do I need to keep the GA4 client in my server container?

The server-side purchase backup of the Measurebase plugins arrives as a GA4 request, and so do Google tag events if you send some events that way. The data client handles only the data tag's requests.

Continue reading

Ready to improve your tracking setup?

Start free, no credit card required. Live in about 15 minutes.

Start free