# Any way to give precedence to the IP Address collected client-side when using Track HTTP API to send server-side events?

**URL:** <https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747>\
**Category:** API & integrations\
**Created:** [August 19, 2023, 3:40pm UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747 "2023-08-19T15:40:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lharris](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@lharris](https://community.piwik.pro/u/lharris)\
**Post date:** [August 19, 2023, 3:40pm UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/1 "2023-08-19T15:40:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [August 21, 2023, 11:57am UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/2 "2023-08-21T11:57:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lharris](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@lharris](https://community.piwik.pro/u/lharris)\
**Post date:** [August 22, 2023, 6:23pm UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/3 "2023-08-22T18:23:24Z")

</div>

Thanks for the warm welcome and for confirming! I really appreciate the info.

~ Lauren

---

<div class="post-metadata">

**Author:** ![mikkovai](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/mikkovai/32/1881_2.png) [@mikkovai](https://community.piwik.pro/u/mikkovai)\
**Post date:** [June 6, 2025, 10:41am UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/4 "2025-06-06T10:41:09Z")

</div>

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](https://www.simoahava.com/analytics/new-piwik-pro-templates-server-side-google-tag-manager/#how-the-client-works)), 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?

---

<div class="post-metadata">

**Author:** ![Simo\_Ahava](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/simo_ahava/32/4351_2.png) [@Simo\_Ahava](https://community.piwik.pro/u/Simo_Ahava)\
**Post date:** [June 6, 2025, 12:48pm UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/5 "2025-06-06T12:48:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikkovai](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/mikkovai/32/1881_2.png) [@mikkovai](https://community.piwik.pro/u/mikkovai)\
**Post date:** [June 8, 2025, 6:02pm UTC](https://community.piwik.pro/t/any-way-to-give-precedence-to-the-ip-address-collected-client-side-when-using-track-http-api-to-send-server-side-events/2747/6 "2025-06-08T18:02:50Z")

</div>

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.
