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

Support App + Web properties on Google Analytics (gtag) #24621

Open
jeffjose opened this issue Sep 18, 2019 · 177 comments
Open

Support App + Web properties on Google Analytics (gtag) #24621

jeffjose opened this issue Sep 18, 2019 · 177 comments

Comments

@jeffjose
Copy link
Contributor

jeffjose commented Sep 18, 2019

App + Web properties is a new feature that Google Analytics that unifiies measurements on app and web properties.

Support this in gtag.js

cc/ @avimehta @zikas @zhouyx

@pschneider87
Copy link

slight push - since more and more users are implementing App+Web with a double-tagging approach, is there a ETA for this issue we can communicate?

@smonnier
Copy link

smonnier commented Nov 4, 2020

+1 on this one. GA4 is now the default Analytics experience . We would need an ETA for a better planning for some of our clients. Thanks a lot

@Beethoven
Copy link

+1 on this. "The new Google Analytics is now the default experience for new properties and is where we’re investing in future improvements."

@funkymusic
Copy link

+1. Covering the entire user journey and all touchpoints including AMP is crucial for having proper insights.

@smonnier
Copy link

smonnier commented Nov 18, 2020 via email

@micajuine-ho
Copy link
Contributor

From another thread: We are in the process of syncing with the GA4 team to get an estimate for the work need for GA4 to be supported in AMP. I will update here with more information once we get it.

@tripledm
Copy link

+1 to this as a list of clients now requesting the migration to GA4.

@Beethoven
Copy link

+1 for this for AMP pages and Web Stories since the new Google Analytics is now the default

@rockeynebhwani
Copy link

+1

1 similar comment
@austintude
Copy link

+1

@ecolli2000
Copy link

AMP integration is crucial for having proper insights. without it is a big issue for pubs

@apoorvmote
Copy link

Luckily I use both amp and non amp pages. So I am using GA4 for non amp and older version for amp page. So please post here once amp is supported for GA4.

@supernovae
Copy link

Not having AMP support is making a lot of publishers question Google's long term plans with AMP. I know there was a commitment blog posted in November, but since then the AMP board has been re-started and many publishers are writing that the "writing is on the wall" with AMP.... Convincing people to try GA4 and not supporting AMP is a bad experience for publishers.

@rodrigocarlos
Copy link

AMP is a Google initiative project, and Google itself does not create compatibility of the new code (GA4) with the AMP version.
That's funny.

I am waiting for Google to give GA4 compatibility for the project where he gave the initiative.

@jaumesun
Copy link

+1

1 similar comment
@tobiastromm
Copy link

+1

@drewroberts
Copy link

Do you have an update for us, @micajuine-ho?

We are in the process of syncing with the GA4 team to get an estimate for the work need for GA4 to be supported in AMP. I will update here with more information once we get it.

I'm trying to switch over a few properties to GA4 to take advantage of the Ecommerce reporting capabilities. The GA4 tag option will also need to be added to the AMP container types on Google Tag Manager.

@stephengardner
Copy link

11 days since the last comment, really hoping we can give users an update of some sort. Any news?

@micajuine-ho
Copy link
Contributor

Hi all. Thank you for your patience. Still no updates to report. We are trying to determine how best to support GA4. Hopefully we will have more progress soon.

@annanyc
Copy link

annanyc commented Mar 26, 2023 via email

@zoolyka
Copy link

zoolyka commented Mar 26, 2023

This method is really easy to set up and it works great. I don't think there will be an official solution anytime soon.

@yasinturkdogan
Copy link

I have been using the above mentioned method but the numbers are not matching with Universal Analytics and it is not even close. It shows almost half of the numbers I am seeing Universal Analytics. This only happens for AMP pages, non AMP pages are almost equal. So it is for sure something regarding the AMP setup but still couldn't figure out yet. Anyone has the same issue? You can check my implementation if you are interested in here: https://www.kevserinmutfagi.com/

@igordnt
Copy link

igordnt commented Apr 10, 2023

I'm having the same issue @yasinturkdogan. Implementation seems perfect, but numbers do not match. I simply removed everything and now I'm waiting for an official response from Google. If support doesn't come, I will simply uninstall AMP.

@luizcruz
Copy link

Any news guys?

@chasefinch
Copy link

The link mentioned a few times in this thread — https://www.thyngster.com/how-to-track-amp-pages-with-google-analytics-4 — worked great for us.

@fanatixgithub
Copy link

fanatixgithub commented Apr 21, 2023

I'm in the same boat with you guys @yasinturkdogan @igordnt

I run a fleet of 15 or so sites with UK-focused but also very international readership, ranging from ~500k monthly unique visitors up to ~12m - so I've quite a variety of samples. Followed that tutorial from thyngster, and while on web GA4 pvs are only down ~3% versus UA, on AMP I'm averaging ~64% lower. I've tried to correlate this drop against various things (could it be people with a specific browser? or in a specific geo? time of day?) and not found any indication that there's a single cause. It just seems to fail "sometimes", for no reason I can discern.

AMP has always been a huge waste of time and effort and if we're witnessing its death throes then I'm overjoyed, but please Google, just confirm it either way.

@luizcruz
Copy link

The link mentioned a few times in this thread — https://www.thyngster.com/how-to-track-amp-pages-with-google-analytics-4 — worked great for us.

We already implemented it and it didn't work as it should. We were told by Google that they were working on it. I hope it is true :)

@thyngster
Copy link

thyngster commented Apr 24, 2023

Hi. The only reason i can think of for these numbers differences. is that if you're using the CDN, it may happening that some users may not be getting the proper CORS headers, having the JSON loading blocked by AMP and therefore not firing anything. Since the requests are cached, having a few users not getting the proper headers would imply having that spread to other users.

An update is being rolled out right now, that should ( I hope ) taking care of that issue doing some fallbacks to properly return the origin for all requests.

If any of you having some data discrepancies, could check in some days if there has been any improvement it would be really appreciated. ( i was not able myself to replicate the issue at all, so I'm just guessing around )

@fanatixgithub
Copy link

if you're using the CDN

For the ga4.json file? Can rule that out in my case at least, as I'm self-hosting that file on each of my sites' own domains.

@thyngster
Copy link

If could share the domains via some private way ( ie: my blog contact form), it would be helpful

@cnxsoft
Copy link

cnxsoft commented Apr 24, 2023

An update is being rolled out right now, that should ( I hope ) taking care of that issue doing some fallbacks to properly return the origin for all requests.

I'm self-hosting the ga4.json file using the plugin @ https://wordpress.org/plugins/amp-google-analytics-4-support/
The plugin does not seem to be updated. Would it be OK to just overwrite the ga4.json file in the plugin with the file @ https://github.com/analytics-debugger/google-analytics-4-for-amp/blob/main/ga4.json

@thyngster
Copy link

I really think, all the updates has been backwards compatible, you should not have any issue ...

@thyngster
Copy link

thyngster commented Apr 24, 2023

@cnxsoft are you properly sending the CORS headers from people loading your pages from AMP CDN? I checked that extension and it's not setting any headers while serving the JSON.

Take it main that when users loads your content via google they will end on an url like: https://www.google.es/amp/s/www.domain.com/url, and that there will be a request to the ga4.json file from a host like:

https://www-domain-com.cdn.ampproject.org

If you're not returning a proper CORS headers for that domain, ga4.json loading will be blocked by the browser.
You need to properly server the ga4.json adding the needed cors headers:

    header("Access-Control-Allow-Origin: {$origin}");
    header("Access-Control-Allow-Credentials: true");

I feel this is not the best place to discusse all these. mind if we move this conversation to my repo or privately? let this ticket to be focused on the official support information ... ( sorry for the mess )

@pabloaugusto
Copy link

pabloaugusto commented May 2, 2023

Hi. The only reason i can think of for these numbers differences. is that if you're using the CDN, it may happening that some users may not be getting the proper CORS headers, having the JSON loading blocked by AMP and therefore not firing anything. Since the requests are cached, having a few users not getting the proper headers would imply having that spread to other users.

An update is being rolled out right now, that should ( I hope ) taking care of that issue doing some fallbacks to properly return the origin for all requests.

If any of you having some data discrepancies, could check in some days if there has been any improvement it would be really appreciated. ( i was not able myself to replicate the issue at all, so I'm just guessing around )

I have the same problem here. My data is about 60% smaller in GA4 AMP in GA UA AMP is ok.
I'm hosting the ga4.file myself too

@thyngster
Copy link

@pabloaugusto let's keep the focus of this thread on the official support from AMP team. Please move the conversation to the other repo if needed.

@pabloaugusto
Copy link

@pabloaugusto let's keep the focus of this thread on the official support from AMP team. Please move the conversation to the other repo if needed.

Done.

CC: @cnxsoft @fanatixgithub @igordnt

@erwinmombay
Copy link
Member

Hey all, I'd like to share that AMP is now supported in Google Analytics 4, reaching parity with Universal Analytics and ensuring that you can measure performance on your AMP pages with GA4. You can learn how to implement the integration and get started today: https://support.google.com/analytics/answer/13707678

additional implementation documentation:
https://developers.google.com/analytics/devguides/collection/amp-analytics
https://developers.google.com/tag-platform/gtagjs/amp?technology=gtagjs

@annanyc
Copy link

annanyc commented Jun 28, 2023

Do you have AMP documentation for GA4 in Google Tag Manager?

@Jhkier
Copy link

Jhkier commented Jun 28, 2023 via email

@erwinmombay
Copy link
Member

forwarding response from GA team to the question: "We currently don't support deploying the GA4 for AMP tag through Google Tag Manager"

@annanyc
Copy link

annanyc commented Jul 11, 2023 via email

@fedex1
Copy link

fedex1 commented Jul 21, 2023

Is there any alternative with the AMP page to use GA4?

Can we have an interim solution that uses the supported non amp version?

AMP seems like such a good idea, but things like this make it appear that AMP is low priority at Google.

:(

@Sitanderkumar
Copy link

Sitanderkumar commented Sep 5, 2023

Hey all, I'd like to share that AMP is now supported in Google Analytics 4, reaching parity with Universal Analytics and ensuring that you can measure performance on your AMP pages with GA4. You can learn how to implement the integration and get started today: https://support.google.com/analytics/answer/13707678

additional implementation documentation: https://developers.google.com/analytics/devguides/collection/amp-analytics https://developers.google.com/tag-platform/gtagjs/amp?technology=gtagjs

In spite of following the instructions, I am receiving the error "Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.". Could someone help resolve this issue, and is there any method to debug and verify the real-time data in GA4 to ensure that it is implemented correctly?
attaching the error image
image

@zikas
Copy link
Contributor

zikas commented Sep 5, 2023

@Sitanderkumar

Are you sure it's the problem with AMP? based on the stack, the error seems to be coming from a chrome extension

@Sitanderkumar
Copy link

My apologies, it was due to some extensions. However, I am receiving an error message (Invalid or missing web property ID) in Google tag assistance. I checked my code and it seems that I am using the right ID. I tried to reset the tag but still, I am not able to make it work. I need help to solve this issue.Do you have any suggestions on how I can check to ensure that it has been implemented correctly?

@zikas
Copy link
Contributor

zikas commented Sep 8, 2023

Unfortunately, Tag Assistant doesn't support AMP today.
I think best next thing would be to look at GA realitime report to confirm that the setup works correctly.

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

No branches or pull requests