GA4 Measurement protocol IP override
Asked Answered
L

3

7

When sending events to GA4 is there a way to override user ip, if using universal analytics you could have passed a user_ip variable uip but for GA4 I dont see a param option to pass user ip. Any help would be appreciated

Lancey answered 23/8, 2021 at 15:24 Comment(0)
S
3

OK found a temporary solution here.

instead of &uip=x.x.x.x in the url, add &_uip=x.x.x.x.

Google tends to prefix alpha/beta URL parameters with underscore _

Scurrility answered 30/6, 2022 at 23:27 Comment(2)
Doesn't seems to be working anymoreOverflow
@Overflow at least /g/collect works for me. Did you try specifying both uip and _uip?Incorporator
D
0

you can use ip_override parameter to override it.

Dalmatic answered 6/8 at 7:45 Comment(0)
B
-5

No parameter is necessary:

For Google Analytics 4 properties, IP anonymization is enabled by default. The content provided below describes the IP anonymization process for legacy Google Analytics tags.

Source

So this isn't even handled on the level of code (i.e. you couldn't enable it if you tried), it's built into the property.

Bo answered 23/8, 2021 at 16:43 Comment(5)
This assumes you are using gtag to send events, im talking about using measurement protocolLancey
This assumes your property is GA4. This is built-in at the property level, not something you set inside your request.Bo
Btw. it has been this way since the beginning when it was still called App&Web. If you do not believe me, would you believe GTM/GA Guru Simo Ahava? simoahava.com/analytics/… - look in the comments (I know, appeal to authority, but he is Google Developers Experts and has work with that pretty much from the start).Bo
IP anonymization masks the given IP. IP override is another thing. support.google.com/analytics/answer/2763052?hl=enLipread
@MohammadNikravan you are obviously right and I have no idea how I came up with that answer.Bo

© 2022 - 2024 — McMap. All rights reserved.