Hello! Hope all are well!
We are using the Track HTTP API to report call and call conversion events. Since these events are being reported from our servers, we are noticing that the real visitor IP Address that was captured from the web session appears to be entirely overwritten by our server’s IP Address.
Is there any way to make it so the IP Address associated with our server-side event does not overwrite the real visitor’s IP Address captured from the client (or, at a minimum, to isolate the server IP Address to that particular event)?
I do see the cip parameter in the documentation and I understand we need to have an auth token to pass that value successfully, but the problem is that most of our customers do not have us collecting the visitor’s IP Address, so we typically do not have that value to pass!
I suppose I’d like to see if there is a work-around or way to have the Track HTTP API processing logic give precedence to the client-side IP Address (almost ignoring our server IP Address), but still process and attribute the event info successfully.
Thanks so much for any insights or guidance you might be able to provide!
~ Lauren
Hi Lauren,
Welcome to our community!
The only way to change the IP sent to Piwik PRO is via cip
parameter. The server you are using should have access to the IP that the request came from and you could use it in cip
parameter.
Best,
Oliwer
Thanks for the warm welcome and for confirming! I really appreciate the info.
~ Lauren
Hi!
Coming back to this old post (maybe this should be a new thread, if relevant let me know and I’ll move it), but I found a similar issue in a Piwik PRO server-side setup. I have a Piwik tracker running in client-side GTM, which passes hits fine to the server-side Piwik Client, but not through the tag and onwards to Piwik analytics. The tag doesn’t seem to carry any IP field, and in Piwik the IP is the server’s IP, for all users and hits.
I assumed the Client template would pass the ip_override value to the Piwik tag as cip
(like I understand from Simo’s article), and the tag would pass it on, since it has “Inherit from Client” by default in the “Override User IP” field.
So to get the IP passed all the way to Piwik, you need to create a variable for a request header that contains the IP, or use the ip_override
value, and add that to the Override User IP field.
I’m wondering if this is a bug in the client or tag template, or am I missing something?
Howdy!
If you’re using the JS tracker, then the SGTM Client does a best effort attempt to get your IP address by looking at HTTP request headers like forwarded-for
, x-forwarded-for
. These are not always available, depending on your server-side stack, and sometimes they are intentionally removed if using proxies (or if the server has multiple proxy hops).
If you don’t see ip_override
populated with your IP in the Event Data when previewing the SGTM container, it means that the IP fetch doesn’t work. In that case, you need to override the IP field in the SGTM Piwik PRO Tag settings with the user’s IP. Go through the incoming HTTP request headers to see if the IP is in some custom field (and then create a Request Header variable for that). If it’s not at all available server-side and you can’t configure the proxies to allow it to be forwarded, then one last option is to expose the IP address client-side in the dataLayer for example, and then send it as a custom parameter with the Piwik PRO client-side hit to SGTM.
Simo
2 Likes
After extensive debugging I realised I should look at the active event data augmentations. And of course, there is ip_override
being excluded from all clients and all hits 
Thanks, sorry, and I’ll get my coat now.