We already discussed why you would want to use your Own CDN for server side tracking.
The part that a lot of people omit, is that in such a setup your server GTM will receive a request from an IP of your CDN provider, not the actual IP of the user, which may have an effect on your reporting. Here’s an example:
My IP is: 193.193.212.69 but since the subdomain pointed to my sGTM is proxied through Cloudflare, I get a completely different address in the Common Event Data:
This means incorrect geo data in your destinations (GA4 would be the most obvious one), and of course also throws a wrench into whatever tags/functionality you may have directly reliant on IP address.
Let's look at the Cloudflare example, the most commonly used CDN. The original IP address will always be available in Cf-Connecting-Ip header:
We can access this data with a native Request Header variable, very straightforward:
Now that we have a proper IP available to us in a variable, we need to apply to our tags. The simplest way to apply to all your sGTM tags is to use Transformations:
1. Go to Transformations section of your sGTM.
2. Create a new one, pick ‘Augment Event’:
3. We want to augment event data, so that ip_override (a common event data parameter used by all the tags) is replaced with the value of our header, which we’ve previously created a variable for:
4. Hit ‘Save’ - now all your sGTM tags will reference a proper user IP:
Happy tagging!
Sure, we've got you covered! Click Get assistance, fill-up the form, and we will send you a quote.