Server side tagging - wrong X-Appengine data

126 views
Skip to first unread message

Tuur Goormans

unread,
May 19, 2021, 5:58:28 AM5/19/21
to Google App Engine

Hello, I was wondering, have any of you set up Server Side Tagging in Google Tag Manager?

I am receiving a geolocation issue here. First I used the Google’s App Engine domain.

Through this setup, I received the following information in my HTTP requests with correct values:

  • X-Appengine-Country
  • X-Appengine-City
  • X-Forwarded-For
  • X-Appengine-User-Ip

But now, since I linked my own sub domain to run everything in first party context, the values of these data aren’t right anymore. For some reason the X-Appengine-User-Ip uses the second value of X-Forwarded-For (and not the first anymore). Which results in wrong geolocation (as it uses the proxy IP and not the actual IP anymore). 

This issue results in wrong data in GA / GA4, as well as bad matching rate in Facebook Ads Manager.

Any tips on how I can fix this?

Thanks!

goya

unread,
Jun 23, 2021, 11:56:41 AM6/23/21
to Google App Engine

With the current information it is difficult to know how you are getting this value, but have you tried using any of the headers below to get the information you are looking for?


    "X-Forwarded-For",

    "Proxy-Client-IP",

    "WL-Proxy-Client-IP",

    "HTTP_X_FORWARDED_FOR",

    "HTTP_X_FORWARDED",

    "HTTP_X_CLUSTER_CLIENT_IP",

    "HTTP_CLIENT_IP",

    "HTTP_FORWARDED_FOR",

    "HTTP_FORWARDED",

    "HTTP_VIA",

    "REMOTE_ADDR" 


Otherwise, please attach a code sample of how you are getting the header content in your code (please redact any private or possibly sensitive information before sharing, as this is an open discussion), to try to reproduce and further troubleshoot.

Reply all
Reply to author
Forward
0 new messages