Server-side tagging is all about management. With the ability to intercept, modify, and even block requests as they arrive in earlier than they’re dispatched to their precise endpoints is extraordinarily helpful.
The built-in Google Analytics 4 tag template has choices for modifying occasion parameters and consumer properties within the Google Analytics 4 request, however do you know you need to use these choices to switch a few of the fields as nicely, comparable to Shopper ID, Consumer ID, and occasion Engagement Time?
On this article, I’ll construct a complete listing of all of the fields you can edit. Please let me know within the feedback in case you discover fields that I might need missed, and I’ll add them to the listing.
X
The Simmer Publication
Subscribe to the Simmer publication to get the most recent information and content material from Simo Ahava into your e mail inbox!
Tip 135: Override fields within the GA4 tag utilizing SGTM
To edit the fields, it’s essential use the choice underneath Occasion Parameters labeled Parameters to Add / Edit. This can not work when you attempt to add the fields underneath Consumer Properties.
So as to add or edit a discipline, seek the advice of the listing beneath. The sector names are derived from the Occasion Information object. Not all fields within the Occasion Information object will be edited.
Check out the screenshot above for an instance of methods to manually set the consumer’s IP handle utilizing the sphere ip_override
.
Notice that the GA4 tag robotically truncates the final octet of the IP handle to
0
, so setting it to1.2.3.4
can have the identical impact as setting it to1.2.3.0
.
Subject title | Description | Pattern worth |
---|---|---|
campaign_content |
Marketing campaign Content material. | my_campaign |
campaign_id |
Marketing campaign ID. | cpb12345 |
campaign_medium |
Marketing campaign Medium. | e mail |
campaign_name |
Marketing campaign Title. | january2023 |
campaign_source |
Marketing campaign Supply. | publication |
campaign_term |
Marketing campaign Time period. | footwear |
client_hints.cellular |
Shopper Hints API. 1 if system is cellular, 0 if not. |
1 |
client_hints.platform |
Shopper Hints API. Platform title. | macOS |
client_id |
Google Analytics Shopper ID. | 1234567.1234567 |
engagement_time_msec |
Engagement Time in milliseconds. | 1000 |
ga_session_id |
GA4 session ID. | 1680157606 |
ga_session_number |
GA4 session depend. | 4 |
ip_override |
Consumer’s IP handle. | 192.168.1.1 |
language |
Browser language. | en-us |
page_location |
Web page URL. | https://www.simoahava.com/check/ |
page_referrer |
Web page Referrer. | https://google.com |
page_title |
Web page Title. | My House Web page |
user_agent |
Consumer Agent string (will get set within the outgoing request headers). | Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Construct/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Cell Safari/537.36 |
user_id |
GA4 Consumer ID. | my_crm_id_abc |
x-ga-page_id |
Web page ID. | my_page_id_11111 |
The rule of thumb is that if the sphere is obtainable within the Occasion Information object, which you’ll be able to simply debug in server-side tagging Preview mode, you possibly can override it utilizing the occasion information key from that object.
Nonetheless, I discovered that fields that start with x-ga
(GA’s personal inner settings) can’t be overridden aside from the elusive x-ga-page_id
. This implies that you could’t set successful as a First Go to (x-ga-system_properties.fv
) or as a Session Begin (x-ga-system_properties.ss
) except the incoming stream already set these values.
Please let me know within the feedback if I missed some fields. I’ll replace the listing accordingly.