Question
Is Google Tag Gateway (GTG) supported with the Segment Google Analytics 4 (GA4) Web destination? If so, how can I update the scripts to use the new measurement path?
Product
Twilio Segment
Answer
Yes, Google Tag Gateway is supported with the GA4 Web destination. You can route both the gtag.js script and your measurement hits through your Content Delivery Network (CDN) endpoint by configuring two specific settings within your Segment workspace.
First, you can input your GTG CDN domain into the Google Custom Domain field within the GA4 Web destination settings to properly route the script. Second, you can pass the required transport_url parameter using the destination's mapping configuration to ensure measurement hits are sent to your custom endpoint.
Additional Information
To complete this configuration, follow these steps within the Segment App:
- Navigate to Destinations and select your GA4 Web destination.
- In the Settings tab, locate the Google Custom Domain field and enter your GTG CDN domain. Save the changes.
- Switch to the Mappings tab and edit your event mappings (such as the Set Configuration Fields mapping).
- Add
transport_urlas a configuration field and set its value to your GTG measurement endpoint. - Save and deploy the mapping changes, then test your implementation to confirm that both the library script and the subsequent event payloads flow through your CDN.