Step-by-Step Guide: How to Implement Meta Conversion API with Server Side GTM and Google Cloud App Engine

Sergei Kogut - March 14, 2023

Digital analytics can provide invaluable insights into website performance and user behavior. However, tracking website data with traditional client-side methods can be limited by ad-blockers, browser cookie settings, and other factors that can prevent on-page tracking code from firing properly. Fortunately, the GTM Server Side approach in activating the Meta/Facebook Conversion API offers a solution. In this blog post, we’ll provide an overview of the GTM Server Side containers, explain the benefits of server- side tracking, and walk you through the steps of implementing this approach.

The Benefits of GTM Server Side

With GTM Server Side, data is processed on the server that resides on the same top-level domain as the rest of the website. This means that server-side tracking is less likely to be impacted by ad-blockers, cookie policies, and other factors. In addition, GTM Server Side can help prevent data discrepancies that can occur with traditional client-side tracking.

Implementation Overview

Implementing GTM Server Side involves three main parts:

  1. A new “sGTM” container (GTM configured for server-side deployment)
  2. A Google Cloud App Engine project (to host the GTM container)
  3. New DNS records on your domain registrar or hosting platform to point your new tracking subdomain to the App Engine servers

Traditional Tracking vs. Server-Side Tracking

With traditional client-side tracking, your website loads in a browser window along with your GTM container. GTM then fires the Meta Pixel Tag. The Meta Pixel sends data collected from GTM and the browser to the Facebook tracking URL –

With server-side tracking, your website loads in a browser window along with your GTM container. GTM then fires a modified Meta Pixel Tag. This version of the pixel sends data collected from GTM and the browser to your own tracking URL  – for example That’s where your new sGTM container is hosted by Google Cloud App Engine. The sGTM container then fires the usual, unmodified version of Meta Pixel that sends a copy of that data to the Facebook tracking URL –

Google Cloud App Engine

Google Cloud App Engine is a Platform-as-a-Service (PaaS) offering that allows you to deploy and run your web applications on Google’s infrastructure. The pricing for App Engine is based on a few different factors, including the number of instances you need, the amount of traffic your application receives, and the resources required to run your application.

One important thing to note is that App Engine automatically scales your application in response to traffic, so you only pay for what you use. For example, if you have a website that typically receives 10,000 monthly pageviews, you may only need three server instances at $40/month. However, if your traffic spikes to 1,000,000 or 10,000,000 monthly pageviews, App Engine will dynamically adjust the number of instances and resources required to handle the increased traffic volume, and your pricing will increase accordingly.


To use the GTM Server Side approach, you will need to set up a new subdomain on your hosting provider that will be used to handle server-side requests. These subdomains will be hosted on the Google Cloud App Engine and will be used to handle incoming tracking requests from the client-side Meta Pixel.

Typically, you would set up at least two subdomains: one for the production container and one for the testing container. The production container subdomain will handle the live server-side requests, while the preview container subdomain will be used to test and preview changes before they are pushed to the live environment.

Step-by-step Implementation

First, someone with Admin access to GTM needs to create a new server-side container:

  1. Log into Google Tag Manager ( and create a new container, selecting “Server” as the target platform.
  2. When prompted, select the option to “automatically provision tagging server”. This will automatically create and configure an App Engine project for you. This step may take a few minutes, so be patient and don’t leave that page.
  3. After the App Engine project is created, you will be prompted to set up a billing account (or select a billing account if one already exists in your Google Cloud portal).
  4. If you don’t have a billing account yet, you’ll need to add a credit card number before you can complete this setup.
  5. Once your billing account is set up, you’ll be able to configure your new server-side container in GTM.

Next, you’ll need to add your subdomains to the App Engine project:

  1. Go to the Google Cloud Console ( and select your App Engine project from the drop-down menu.
  2. Click on the “App Engine” menu item in the left-hand “hamburger” navigation menu.
  3. Click on the “Settings” button located at the bottom left of the App Engine navigation menu.
  4. Select the “Custom Domains” tab and click on the “Add a Custom Domain” button.
  5. In the “Domain Name” field, enter the subdomain that you want to add to your App Engine project (for example
  6. Click the “Verify” button to prove that you own the domain.
  7. Follow the prompts to verify your ownership of the domain, which may involve uploading a text file to the root directory of your website or adding DNS records to your domain registrar or hosting provider.
  8. Once your domain is verified, you can configure it to point to your App Engine project. This will involve adding new CNAME and A records to your DNS settings.
  9. Test your new subdomain by navigating to it in a web browser.

Next, you’ll need to deploy your new App Engine project:

  1. Go to the Google Cloud Console again and select your App Engine project from the drop-down menu.
  2. Click the “Activate Cloud Shell” icon on the top-right, next to your user account avatar image.
  3. Run the following command in your command prompt:
    bash -c “$(curl -fsSL”
  4. Follow the guided steps and answer a few configuration questions in the command prompt to set up your production environment. It will ask you for a min. and max. number of servers, whether you want logging on or off, and a few other options.
  5. Once the setup process is complete, you can begin testing and deploying your server-side tags in your sGTM container back on the Google Tag Manager platform.


Setting up Meta Conversion API tracking in a server-side container in Google Tag Manager using Google Cloud App Engine is a powerful way to improve the performance and reliability of your web analytics. With these tools and techniques now at your disposal, you can take your digital marketing efforts to the next level and achieve greater success in reaching and engaging your target audiences. If you have any questions or are looking for help with migrating your Meta conversion tracking to the server side, please reach out to

Posted in: Analytics

© 2024 MoreVisibility. All rights reserved.