Google Analytics first party mode / Tag manager gateway setup

Hi Team,

Is there any official documentation to implement the first party mode for Google Tag Manager? ChatGPT has suggested to use proxying Google’s analytics script via a Netlify Function.

More info on first party mode here: Set up Google tag gateway for advertisers  |  Google for Developers

Any insights would be appreciated. Thanks!

Hi, @sandhub. We have no official documentation about this. It should be possible to write a function that implements the functionality required as described in the tab “Other” in the route traffics step on that page.

That said, we do not have prior art that explains how to write such function. That code would need to be written by you.

If there are follow-up questions, please reply here anytime.

1 Like

To set up Google Analytics First-Party Mode with Netlify, you can use a custom Netlify Function to proxy Google’s analytics scripts. While there’s no official documentation, it’s possible to follow the setup steps in Google’s guide to implement it with Google Tag Manager

1 Like