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.
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.
Implementing GTM Server Side involves three main parts:
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 – facebook.com/tr.
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 data.yourdomain.com/collect. 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 – facebook.com/tr.
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.
First, someone with Admin access to GTM needs to create a new server-side container:
Next, you’ll need to add your subdomains to the App Engine project:
Next, you’ll need to deploy your new App Engine project:
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 info@morevisibility.com