Tracking Marketing Server-Side for SaaS with sGTM

Julian Ivaldy
7 min readNov 14, 2024

--

One of the first essential steps before launching marketing campaigns is to set up your tracking (product and marketing). Tracking helps you identify which strategies and funnels are effective and worth enhancing through paid marketing.

Good tracking will allow you to make more informed decisions on which strategies to implement in paid campaigns. Tracking also helps you manage your paid marketing campaigns. In short, tracking is essential, and that’s the focus of this edition. Given the complexity of the subject, I’ve decided to focus on the tracking of subscription-based tools (SaaS). I’ve also written an article about marketing tracking for Mobile Apps.

The goal of this article is to provide all the information needed to set up robust tracking for SaaS, unaffected by blockers. We’ll cover best tracking practices, the transition from client-side to server-side tracking, and a concrete example of setting up tracking for a SaaS product using the server-side GTM (sGTM) method.

An Introduction to SaaS Tracking

Tracking allows you to measure the performance of your product, funnels, and marketing strategies. It’s what enables you to assess the effectiveness of a project you want to test (be it a new feature or an acquisition funnel).

Before setting up your paid marketing tracking, make sure to set up your product tracking. To do this, take a step back and define your product metrics. I recommend this video B2B Startup Metrics | Startup School by Tom Blomfield (YC).

For paid marketing, tracking helps you understand what users do after clicking on an ad, giving you the data you need to optimize your campaigns. Without good tracking, it’s difficult or impossible to know if your marketing efforts are paying off, let alone optimize or monetize them.

For paid marketing, tracking may include:

  • Click-Through Rate (CTR): How many people clicked on your ads relative to the number of impressions.
  • Post-Click Conversion Rate: The percentage of users who take the desired action after clicking an ad (e.g., sign-up, purchase).
  • Cost per Acquisition (CPA): How much it costs to acquire a new user through paid marketing.
  • Return on Ad Spend (ROAS): The revenue generated compared to advertising expenses.

More generally, you can track all events that break down a potential customer’s journey from your ads to your conversion goal (e.g., page visits, sign-up clicks, paywall openings, purchase confirmations).

Traditional Client-Side Tracking Methods

Historically, tracking was done on the client-side, i.e., directly in the user’s browser, using tracking codes known as pixels.

These tracking pixels were embedded in web pages, sending information to ad network servers (like Facebook or Google) each time a user performed an action (such as adding an item to a cart). However, this method has faced increasing limitations due to ad blockers and privacy regulations (GDPR, ATT, ITP, etc.).

The Rise of CAPI & Server-Side Tracking

With the introduction of iOS 14’s App Tracking Transparency (ATT) and Intelligent Tracking Prevention (ITP) on web browsers, client-side tracking has become less effective. Many data points are now inaccurate due to browser blocking. This led to an alternative approach: CAPI (Conversion API) and, more broadly, server-side tracking. These methods bypass ad blockers and cookie deletions by sending data directly from your website’s server to ad networks, ensuring more reliable and comprehensive data collection essential for campaign optimization.

Today, setting up a server-side tracking system is crucial for truly reliable data. While it’s more technical and time-consuming than installing a simple pixel tag, it’s worth it, especially if you’re investing in paid marketing.

Implementing Server-Side Tracking: sGTM

There are various ways to set up your server-side tracking system. For simplicity and compatibility, I recommend implementing server-side tracking via Google Tag Manager (sGTM).

This allows you to centralize and optimize tag management, gain visibility over all tracking codes, and easily interact between client and server. In short, it’s a streamlined and efficient integration solution.

I’ll now outline the steps for setting up a high-performance server-side tracking system for SaaS. To illustrate, Simon will help me configure tracking for a B2B SaaS: Mimetix (TQ23).

Mimetix is a B2B SaaS that makes employees on average 50% more efficient and faster in carrying out their tasks. The tool is designed for startup/scale-up managers who equip their employees with this documentation and automation tool for repetitive processes (based on simple recorded videos). If you’d like more information, here’s the CEO’s contact.

1/ Tagging Plan

The first step in setting up tracking is creating a tagging plan, where you define what you need to measure and how you’ll go about it.

1) Define Your Goals:
Before diving into tracking, clarify what you want to measure, such as lead acquisition, activation, or conversions. Identify the key funnel stages, like sign-up, activation, and conversion to a paid plan.

2) Map the User Journey:
Describe the user journey in your SaaS from the landing page to conversion, including the free trial period. Identify the actions to track at each stage, such as:

  • Landing Page: page views, CTA clicks
  • Sign-Up: form submission, account validation
  • Activation: first login, use of key features
  • Free Trial: start of the trial, use of premium features
  • Conversion: purchase of a paid plan

3) List Trackable Events:
For each journey stage, note the key events to track, such as:

  • Click on the sign-up CTA
  • Sign-up form submission
  • Free trial start
  • Conversion to a paid plan

4) Document in a Table:
After your audit, build a tagging table including:

  • The goals you want to achieve
  • Tag names for events to track
  • Tracking type for each tag
  • Tools associated with each tag
  • Trigger conditions
  • Variables to track
  • Implementation status of each tag

For this example, I’ll set up basic tracking for a sample funnel, consisting of a dedicated landing page, a sign-up page, and a paywall page.

📍 Here is the video tutorial (🇫🇷) for this step:

2/ Google Tag Manager Configuration (Client & Server) with Consent

Once your tagging table is complete and approved, the next step is setting up Google Tag Manager (client-side and server-side), ensuring effective consent management.

Start by creating a server-side container in Google Tag Manager, then manually configure a GTM server (like Adingwell). Don’t forget to set a custom subdomain for tracking and update your DNS records.

Then, create a client-side container to track user-side events in Google Tag Manager. Integrate a user consent management tool that complies with GDPR and ePrivacy (like Cookiebot) in GTM. Use the template available in the GTM tag gallery, set up consent triggers on all pages, and customize the banner appearance if needed.

Once everything is configured, insert the Google Tag Manager and Cookiebot code into your site’s <head> and <body> sections. Don’t forget to test your changes before publishing to ensure everything works as expected.

📍 Here is the video tutorial (🇫🇷) for this step:

3/ Tag Implementation

In this final part, we’ll set up tracking tags in Google Tag Manager (GTM) and Google Ads for precise tracking on the server and client side.

First, for Google Analytics 4 (GA4), it’s essential to set up a GA4 tag in server-side GTM, migrating the client ID from JavaScript to sync client and server data.

Next, add a new GA4 client-side tag in GTM and integrate the measurement ID using a constant variable to avoid future manual updates. Then set up custom triggers based on specific events on your website, like clicks on links or buttons.

For Google Ads, configuration is similar but focuses on conversion tracking. Create a Google Ads conversion tag in GTM, then add a “conversion linker” to enable cross-page tracking. Track specific actions, like free trial start clicks or sign-up form submissions, by setting up triggers based on those actions. After configuring these tags and triggers, test your setup with GTM’s preview function to ensure your tags trigger correctly server-side and client-side.

📍 Here is the video tutorial (🇫🇷) for this step:

Interpreting Your Tracking Results

Once your tracking is live, don’t forget to keep it up to date and interpret the data collected. Use analytics tools like Google Analytics & Looker Studio to create custom dashboards that allow you to view performance at a glance. Good data monitoring will help you identify areas to improve in your campaigns and adjust your strategies.

👋 Thanks for getting to the end of the article, I hope it helps!

If you’d like to go further, feel free to contact me on Twitter.
📍If you’re interested in scaling with Ads, you can book a free audit (30min)

--

--

Julian Ivaldy
Julian Ivaldy

Written by Julian Ivaldy

I help people build their first mobile app | I support and fund those who want to go further with JoinTheQuest.co

No responses yet