Blog Post
14/1/2026

How we migrated 250 media tags to the server - and how it all turned out

Learn how we migrated 250 media tags (Facebook, Google Ads, Sklik, Bing) to server-side GTM. Practical tips, templates, and lessons learned.

How we migrated 250 media tags to the server - and how it all turned out

With the rise of server-side measurement, we are increasingly implementing server-side tracking for our clients not only for analytics, but also for advertising platforms. In this article, I want to share our experience with a server-side implementation of media tags for a larger client - what we learned along the way, which templates we used, and what to watch out for.

The client we worked with already has part of their infrastructure running on Google Cloud Platform. Their server-side GTM runs on Cloud Run, and hits from front-end GTM containers are routed to it (the client measures traffic across multiple domains).

The main migration of GA4 360 to server-side GTM had already been completed earlier. The next step was a server-side implementation for advertising platforms: Google Ads, Facebook, Sklik, and Bing. 

There were several reasons for migrating the media tags:

• speeding up the website by moving media tags to the server (i.e. a better customer experience)

• security - having control over what data individual scripts send from the website

• preparing, for consented users, the setup for sending personal data and enriching it on the server 

In theory, this sounded like a breeze. Google Ads, Facebook, and Bing all have server-side templates. GA4 data is already flowing to the server, so we can use those events to trigger media tags. It should be just a matter of clicking things together - simply mirroring the tags on the server. Except it wasn’t :) 

A bit of context:

At the time of the migration, the two main GTM containers contained:

• 100 GA4 tags

• 250 media tags

• all of this was spread across 7 top-level products

• divided into 50 product groups

• which were further split into 95 individual products :)

All front-end GTM containers were sending data to a single shared server-side GTM container. This meant that the media tags didn’t just need to be moved - they needed to be properly collected from multiple sources, with their triggers and naming consolidated, and then mapped to the correct conversions in each advertising platform.

Facebook: Hybrid CAPI setup

There were originally 54 Facebook tags. Together with the marketing team, we agreed to consolidate them as much as possible into a smaller number of more generic events - this was fully sufficient for campaign setup. The goal was simplification. The catch is that Facebook thrives on data - and from multiple sources.

The client agreed to run the Facebook pixel both in the browser and on the server - a so-called hybrid setup. What does that mean, and why does it make sense?

• When the pixel runs in the browser, it loads the Facebook library on the front end and collects a large amount of user information, including data gathered automatically in the background.

• When you trigger it on the server, it depends entirely on what data you pass to it. This approach is more secure and less sensitive to ad blockers.

What this looks like in practice:

1. From the browser, an event (e.g. page_view) s sent directly to Facebook. It must contain an event_id – for example, a combination of a timestamp and a random number (we generate this in the front-end GTM using a STAPE template).

This variable has its place in the template under the More Settings section.

2. The same trigger simultaneously sends an event (e.g. a GA4 event) to the server - with the same event_id (passed as an event variable).

3. From the server, the same event is then sent to Facebook using the STAPE Facebook template. The Event ID is set in the Server Event Data Override section.

Facebook deduplicates events automatically. If the same event arrives from both sides with the same event_id, Facebook keeps the browser event. If the browser event is missing, the server event is used instead.

The migration looked simple on paper, but in reality it required a manual review of all 54 tags - deciding what to merge, what to keep, what to rename, and what to forward to the server.

In some cases, we had to:

• unify naming across the two main GTM containers,

• create dedicated triggers for the server, or

• send so-called transport tags (if you use a GA4 data stream to pass data to the server).

Imagine that you trigger media remarketing on gtm_consent_update. But this event is not sent to GA4, so you can’t access it on the server. Transport tags are GA4 events sent to the server purely to trigger media tags (they don’t contain the full set of parameters).

We labeled all of these with the same name, for example sgtm_transport_gtmConsentUpdate. On the server, we used them as triggers for media scripts, while at the same time excluding them from firing the GA4 Event Data tag.

🛑 But watch out: for an event like this is the first one in a session, it can carry session source / medium. And if you exclude it from GA, you can end up with “(not set)” in attribution.

Hard-earned lessons :) Practical tips:

• Be very strict about which parameters you forward.

• For example, you probably don’t want to store event_id in GA or BigQuery - exclude it using transformations.

• On the other hand, some parameters can cause a tag to fail (for example, lead_id, or Facebook’s contents parameter incorrectly sent as an object instead of an array).

• Always check the Outgoing request in debug mode to make sure nothing is throwing an error. Server-side debug isn’t as “talkative” as front-end debug, so issues can be much easier to miss.

If your hybrid FB CAPI setup is configured correctly, you’ll start seeing a light-blue line next to individual events in Facebook Events Manager, indicating data that came from the server. The image below shows an example of a perfect outcome that meets Facebook’s highest requirements - more events are being sent from the server than from the browser, deduplication works, and it’s a thing of beauty :) 

Here we’re looking at a form submission event, where ad blockers are very commonly involved. This is where the server-side approach really shines. In addition, Facebook can use not only the event_id for deduplication, but also extra data such as hashed email or phone number (if sending personal data is allowed, we strongly recommend doing so - Facebook has an excellent match rate especially with phone numbers). I’ve seen cases where there were many times more browser events than server events, because the server tag in GTM was blocked due to consent (?), along with a few other quirks.

In the end, with this migration we landed at 33 events successfully deduplicated in a hybrid CAPI setup.

Google Ads

In parallel with the Facebook rollout, we also worked on implementing Google Ads and Sklik. Google Ads and Sklik had a completely different structure compared to Facebook tags - and there were significantly more of them. For Google Ads, there were 72 tags, and the same number for Sklik. Once again, we went through a review cycle with the marketing team: which events to keep, which to merge, and which ones to add after all. This time, we actually went in the opposite direction, and the final number of tags ended up being higher.

For Google Ads and Sklik, no deduplication is needed - the tags are fired either from the browser or from the server.

Sklik

At the time of the migration, Sklik did not have an official server-side template. The team at Optimics created one for the client and later made it publicly available. The template is easy to use, and its setup is no more complex than on the front end.

Bing

Compared to the front-end version, the Bing server-side template includes a wealth of information (including e-commerce data) that you can send to the advertising platform. However, the only required fields are the system ID (UET Tag ID) and the event name.

Consent

And what about consent? The STAPE Facebook template includes an option to specify whether you are sending only consented data to the server, or whether you want the template itself to respect the consent parameter.

Google Ads on the server inherit the Consent Mode parameters from the front end, meaning they pass information to Google about whether the data can or cannot be used.

The Sklik template by Optimics has Consent Mode integration built in.

In the Bing server-side template, there was initially no explicit indication of how consent was handled. We contacted the template author, who promised to add this information - and did. In practice, the tag is now sent together with an explicit consent or no-consent parameter.

Summary 

This was not a technically complex migration, but it required a lot of testing and attention to detail.

For each tag, we had to verify that the server-side trigger fired the tag correctly - otherwise, marketing would have lost conversions.

At the time of the migration, Sklik did not have an official server-side template. The team at Optimics created one for the client and later made it publicly available (link).

Sklik, Bing, and the remaining tags were then taken over by the client’s lead analyst - a big thank-you to him and the entire marketing team for their great collaboration and support. After several months of testing and deep-diving into tag configurations, I was even dreaming about tags, and I was more than happy to hand the project over.

List of used templates + links

Facebook Conversion API by STAPE (server tag)

Unique Event ID (front-end variable)

Google Ads Conversion Linker + Conversion Tracking (server standard tags)

Sklik template by Optimics (server tag)

Bing template (server tag)

Server-side migration may feel like a routine task these days - but trust us, it can still be quite a ride :)

#
Series
Media data in Google BigQuery: How to get started
8/6/2026

How do you get data from multiple ad platforms into a single data warehouse, typically BigQuery? We’ll walk through the core architecture and key decisions before you start exporting data from Google Ads, Meta Ads, Sklik, and other platforms.

#
Series
First-party data in online advertising, part 3: Debugging – how to verify that everything works
1/6/2026

Part 3 of our first-party data series gets technical again – we'll show you how to check that data is correctly reaching each system and doing what it should. We'll look at outgoing hits in DevTools and at checks directly in the ad platforms.

#
Blog post
GA4 Sessionization in BigQuery
24/5/2026

A detailed guide to sessionizing the GA4 BigQuery export — from identifying sessions and reliably ordering events to two attribution models (First Event Available and Session Start), their limitations, and validating agreement between them.

#
Blog post
How (and Why) We Back Up ClickUp
27/4/2026

Take a look at our ClickUp backup solution. Automated exports, a GitHub repository, and a practical guide to keeping your company data under control.

#
Series
Server-side tracking, part 1: How to get started with Cloud Run
20/4/2026

Learn how to deploy server-side tracking on Google Cloud Run. Compare Stape vs Cloud Run, configure load balancers, choose billing types, and test your setup.

#
Series
First-party data in online advertising, part 2: How to collect it and send it to media systems
2/4/2026

Complete technical guide to collecting first-party data via dataLayer, normalizing, hashing, and sending through server-side GTM to Google Ads and Meta.

#
Blog post
ClickUp MCP testing
15/3/2026

Testing ClickUp MCP: hands-on experience with AI-powered automation, security concerns with access tokens, practical limitations, and who should use it.

#
Series
First-party data in online advertising, part 1: How it works and why it improves campaign performance
23/2/2026

Learn how first-party data improves campaign performance, measurement accuracy, and cross-device tracking. Discover practical ways to collect and use it.

#
Blog post
How we migrated 250 media tags to the server - and how it all turned out
14/1/2026

Learn how we migrated 250 media tags (Facebook, Google Ads, Sklik, Bing) to server-side GTM. Practical tips, templates, and lessons learned.

#
Blog post
Analytics Workshops at Agencies
20/12/2025

Workshops on advanced digital analytics: BigQuery, cookieless tracking, consent, attribution, and building data warehouses for reporting and activation.

#
Blog post
Analytics is a great career path for women - including moms returning from (or during) maternity leave
20/11/2025

Why analytics is an excellent career for women, including those returning from maternity leave. A personal story about transitioning into data analytics.

#
Blog post
BigQuery: How to move a GA4 dataset to another GCP project
1/11/2025

Learn how to transfer historical GA4 data between BigQuery projects using Data Transfer Service. Step-by-step guide for dataset migration and billing.

#
Blog post
Reshoper 2025
15/10/2025

A look back at Reshoper - advising e-shop owners on tracking and measurement, plus a roundtable on marketing automation with insights on self-hosted N8N.

#
Blog post
Hack Your Weekend
23/9/2025

From Idea to App in 48 Hours 🚀 Building AI-powered apps at #HackYourWeekend using Claude Code, tracking with BigQuery, and lessons from team development.

#
Blog post
MeasureCamp Brno 2025
10/9/2025

Recap of MeasureCamp Brno 2025: server-side tracking insights, legal tracking without consent, and Women in Analytics session by MeasureDesign team.

#
Blog post
PPC summer camp
20/8/2025

Recap of PPC Camp: my presentation on legally measuring data without user consent - cookieless tracking, sGTM, BigQuery, Facebook conversions, and Advanced Consent Mode risks.

#
Blog post
How to calculate the date of Easter in BigQuery
16/4/2025

Ready-to-use BigQuery SQL script to calculate Easter dates (2024-2100) using Computus algorithm. Perfect for filtering GA4 data and analyzing seasonal trends.

#
Blog post
Visibility Thursday
25/2/2025

GA4 + BigQuery in practice: connecting analytics, CRM & media data, real-world use cases from IKEA, Shoptet, McDonald's & Česká spořitelna, and what it unlocks for marketing.

#
Podcast
Socials: Vašek Jelen discusses GA4, server-side tracking, BigQuery and connecting customer data with campaign performance
19/11/2024

80-minute podcast with Vašek Jelen on GA4, server-side tracking, BigQuery, and connecting customer data with campaign performance for e-commerce.

#
Blog post
MeasureCamp Prague 2024: Using Google Ads export in Google BigQuery
10/9/2024

Vašek and Anička presented at MeasureCamp Prague on using Google Ads export in BigQuery, combining it with GA4 and CRM data to solve attribution issues.

#
Blog post
Data retention: Storing data in Google Analytics 4
31/8/2024

Learn how to extend GA4 data retention from 2 to 14 months. Understand what retention affects, how to change settings, and what happens after data expires.

#
Blog post
Workshop: GA4 basics for the Tereza non-profit organization
3/6/2024

MeasureDesign led a Google Analytics 4 workshop for Tereza non-profit, focusing on practical data use for their Učíme se venku program.

#
Blog post
Reshoper 2024: New opportunities in analytics
20/5/2024

At the Reshoper conference, I had the opportunity to give a talk where I summarized new opportunities for e-commerce analytics.

#
Blog post
Marketing Festival 2024: Learn to work with GA4 data in BigQuery and GCP
22/2/2024

Workshop on working with GA4 data in BigQuery and Google Cloud. Learn to move beyond the GA4 interface and unlock the potential of raw GA4 data.

#
Webinar
Tips and tricks for GA4 not just for Shoptet users
25/11/2023

Webinar recording with practical recommendations for evaluating campaigns in GA4 for Black Friday and Christmas. Hosted with Marek Čech for Shoptet.

#
Webinar
Webinar: Evaluating GA4 Data in BigQuery
21/6/2023

Public webinar on evaluating campaigns using GA4 dataset in Google BigQuery. Featuring Vašek Ráš and Honza Tichý on DBT, SQL queries, and data flattening.

Vojtěch Černý
IT & Data Developer
Jiří Otipka
Analyst
Lenka Pittnerová
Analyst
Martina Kvasničková
AI & Data Research
Anna Horáková
Analyst
Zuzana Mikyšková
Analyst & Co-Founder
Vašek Jelen
Lead Analyst & Co-Founder
Blanka Hejduková
Back Office
Markéta Svěráková
Analyst
Petra Súkeníková
Analyst
Klára Belzová
Analyst
Vojtěch Černý
Vojtěch Černý
IT & Data Developer

Vojta works at MeasureDesign on developing technical and data solutions that are not only functional, but also practical and easy to use. He enjoys combining web development, automation, and data work to create solutions that make sense both from the user’s perspective and in terms of the technical foundations behind them. What he finds most rewarding is turning a more complex problem into a clean and reliable solution.

Jiří Otipka
Jiří Otipka
Analyst

Jirka has been working in marketing for over 10 years, and if there is anything he enjoys more than numbers themselves, it is connecting them. He loves mathematics and data analytics, and thanks to his interest in exploring source code, he can easily communicate with developers in their own language. At MeasureDesign, he specializes in connecting new data sources - building custom connectors in Python, testing data quality, and exploring which data combinations make the most sense from a business perspective. He is completely at home in Looker Studio and also has extensive experience evaluating PPC campaign performance.

Lenka Pittnerová
Lenka Pittnerová
Analyst

Lenka joined MeasureDesign at the end of 2025, bringing extensive experience from PPC marketing, where she spent many years working with Google Ads, Meta Ads, and other advertising platforms. While managing campaigns, she repeatedly ran into the same issue - poorly set up or insufficient web analytics, which made effective optimization nearly impossible.‍ This challenge initially led her to analytics out of necessity, but over time she discovered that she enjoyed it even more than advertising itself. Today, she focuses primarily on implementing web analytics and data solutions that provide companies with high-quality, reliable data for strategic decision-making and performance marketing. She continues to work on selected PPC projects as well - not only because she still enjoys them, but mainly to stay closely connected to the reality of media platforms and the real needs of clients.

Martina Kvasničková
Martina Kvasničková
AI & Data Research

Marťa helps integrate AI into everyday work—making it faster, more efficient, and accessible to every team member. What excites her most is finding practical ways to use AI and turning new technologies into useful tools.

Anna Horáková
Anna Horáková
Analyst

Anička has over 7 years of experience in the agency world, where she has managed social media ad campaigns for clients, and especially for content-driven websites, her favorite. Wanting to broaden her perspective beyond campaign data, she gradually shifted her focus toward web analytics. She joined our team in 2022 and now specializes in data analytics, using GA4, BigQuery, Looker Studio, and other tools to connect and dig deeper into data — delivering insightful analyses and valuable input for business decisions. Anička was a member of our team until 2026.

Zuzana Mikyšková
Zuzana Mikyšková
Analyst & Co-Founder

Zuzka's career path led her through corporate innovation and research management, running word-of-mouth projects, and later to a digital agency, where she managed website development projects. However, Zuzka is naturally curious and wanted to understand how a website actually works once it is launched into the world. That curiosity led her to study web analytics — and eventually to a key collaboration with Vašek. In 2019, they founded the company together.

Vašek Jelen
Vašek Jelen
Lead Analyst & Co-Founder

Vašek has been working in digital analytics for over 15 years — from setting up tracking to data storage, visualization, and interpretation. He helps companies keep their data in order and make full use of it. He focuses primarily on data from digital platforms such as websites, apps, and client zones, and on connecting that data with other business data like media and customer data. After years of freelancing, he co-founded the analytics studio MeasureDesign, where, in addition to working on analytics projects and bespoke training sessions, he also mentors and educates new analysts.

Blanka Hejduková
Blanka Hejduková
Back Office

Blanka joined our team in 2024 and has been responsible for back-office operations, including invoicing and administrative tasks, ever since. She draws on her experience from the Czech Post and her background in financial management to keep everything running smoothly. In her free time, she enjoys traveling with her two children and finds relaxation in working in her garden.

Markéta Svěráková
Markéta Svěráková
Analyst

Markéta started out in marketing, but then came maternity leave — and with it, total chaos. In an effort to hold on to the last bits of sanity, she turned to data. After all, numbers don’t yell, spill cereal into your keyboard, and at least they make some sense. She completed a data analytics course at Engeto Academy, where she bonded with SQL, Power BI, Excel, and Python, and started looking for patterns outside the bounds of children’s coloring books. Today, at MeasureDesign, she helps clients understand what their numbers are really saying.

Petra Súkeníková
Petra Súkeníková
Analyst

She joined MeasureDesign in 2023, specialising in measurement implementation and reporting. Her favourite moment is when, after all the setup and testing, the first data finally starts flowing in. Her biggest challenge? The unexpected (and often undocumented) changes from Google – those are the times when every analyst turns into a paranormal behaviour expert. 👻 She was a member of our team until summer 2026.

Klára Belzová
Klára Belzová
Analyst

Klára has been with the company since 2019. She focuses mainly on web analytics but is not afraid to dive into data work in BigQuery. What she enjoys most is guiding clients through the entire process — from defining their needs to implementing tracking and creating the final data visualizations. She gets an almost suspicious amount of joy from a clean and well-organized GTM container or a report full of useful data.