-
Notifications
You must be signed in to change notification settings - Fork 927
FR: Allow setting gtag.js config configurations in firebase.analytics() constructor to allow cross-domain setup #3377
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
Comments
I did some investigating using gtag.js only, to understand I suspect this is because it requires a referral exclusion list (mentioned in the "Note" on the gtag cross-domain measurement docs, which links to the referral exclusion docs) and while I did find this setting for Web properties (and it seemed to be already pre-populated with my domain name), I didn't find a similar option for App+Web properties. I'm not sure if the GA team is planning to add this option to App+Web properties or if developers are supposed to achieve the same functionality another way, I can check with them. |
@hsubox76 Hi Christina, thanks for your update. Would be great if you could check with the GA team if they know a possibility to achieve this. |
So I'm told linker functionality has now been enabled in GA4. You can already set this using This functionality will only be available on the new modularized version of the SDK, but that's already available in beta (see #4791) and will be officially released soon. |
This functionality is now available in the modularized SDK, which is in beta. See docs: https://firebase.google.com/docs/reference/js/v9/analytics.md#initializeanalytics Setting a linker would look something like:
|
Describe your environment
Describe the problem
Currently, a cross-domain setup (website on www.example.com, WebApp on app.example.com) with Firebase JS SDK does not seem to be possible in a way that users keep one session even if moving over to the other domain.
In gtag.js, there is the option to set
linker
options as described here: https://developers.google.com/analytics/devguides/collection/gtagjs/cross-domainThis allows to treat separate (sub-)domains as one in terms of keeping the session for one user (including its source, campaign etc. information).
Steps to reproduce:
=> The user's session is killed when moving to the second domain. The second page (app.) has the first one (www.) as referrer even if the session started on
www.*
had an explicit source/medium set with custom campaign information (www.example.com?utm_source=....&...
).This unfortunately also breaks Google Ad campaign information so it is not possible to attribute Firebase conversions made on
app.*
correctly back to the Google Ad that initiated the user visit.And there is currently no workaround as far as I know.
Proposal
My proposal is now to give the possibility to set the
linker
option in thefirebase.analytics()
constructor to be able to setup this linker behavior in gtag also when using it via firebase:When using this, it should hopefully work to track cross-domains with Firebase JS SDK.
The text was updated successfully, but these errors were encountered: