Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the proxy limited to only 1 property/trackingID? And to version 1? #43

Open
sneko opened this issue May 6, 2022 · 1 comment

Comments

@sneko
Copy link

sneko commented May 6, 2022

Hi @joshdk ,

I'm wondering why it's not possible to leave the choice of the destination property to the frontend? Is there any limitation for that? Same for the version hardcoded to "1"?

The proxy could totally rely on the request from the user no? For example by receiving ?v=2&tid=G-AAAAAAA&gtm=2o we can forward to the version "2" with the right trackingID. And for more security the docker could take as environment variable a whitelist of multiple trackingIDs?

What do you think?

(I did not try for now, just looking around which proxy would fit forwarding to GA4 with geolocation...)

Thank you,

@joshdk
Copy link
Owner

joshdk commented Jul 13, 2022

👋🏻 Hello @sneko! Thanks for the questions. To answer them in no particular order:


the version hardcoded to "1"

This project was written targeting the older GA version because I had several existing properties that had various pieces of custom tracking code that I wanted to eliminate.

GA4 isn't currently supported, but that's only because I haven't had time to implement it yet.

why it's not possible to leave the choice of the destination property to the frontend?

This project is primarily intended (as this is how I'm using it) to be deployed as a sidecar container within an existing pod, where that pod serves a single site (or property). The solution to supporting multiple properties is to deploy them as multiple pods, and have individual proxy sidecars for each.

Multiple (vhost-style?) property selection could potentially work, but you would need to maintain a mapping of domains to property IDs.

Is there any limitation for that?

The general goal of this project is to make the collection of analytics completely transparent to both the user agent, as well as to the webservice. Passing GA property IDs back and forth would violate both of these rules, at which point you might as well just use gtag.js etc.


Hopefully that provides some insight. I'm also happy to talk about potential improvements or review pull requests 🙂

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants