![]() When the rendering of an embedded component has started (ie : ads iframes) When the initial contents of an AMP element or AMP document have been loaded. You can read the original docs here: click There are some more that are not currently properly documented on the main docs, so we're not covering them. But you can use any of the AMP event types to track your users interactions. This is cool because we're going even be able to pass User Properties and Event Parameters to our events AMP Events Typesīy default no other events than the “page_view” are tracked. ![]() Remember in GA4 " everything is an event", well, I tried to set up a configuration logic that allows you to track many user interactions using the currently provided functionality in AMP API. "ga4_event_name": "my_customized_page_view" If that’s your case, set the default page view to false, and then add a new trigger to fire a page_view event are your own into the init config: There may be a case where you want to personalize the page_view event name, or maybe you need to add some custom parameters to it. This can be easily achieved by adding the following attribute to our amp-analytics block,īy default a page_view event that will fire on the page load unless you set the DEFAULT_PAGEVIEW_ENABLED to false. In case you want to block the tracking unless the user has implicitly given his consent you can make GA4 not to fire any hits in your AMP pages. To activate this you need to set the “ ENABLE_CONSENT_TRACKING” switch to true, and then a a &gcs parameter will be added to all the hits, containing the actual consent status for the browsing user. If you turn on this feature the current consent status will be reported within the current event hit, allowing Google Analytics to be more GDRP Compliant ( #sigh) and at the same time allowing you to make use of the consent mode modeling when it became available in the future. This will make the tracking compatible with the Google Consent Features. You can have the hits to hold the information about the current consent status. Keep reading this section if you are interested in having a Consent compliance setup in your AMP Pages. This Google Analytics 4 tracking solution for AMP pages, supports the integration with the consent module from AMP and also with Google Consent Mode ( allowing you to attach the consent details to the hits ) If you prefer sending a copy of the hits to some internal database or any other tool, the logic is pretty straightforward so I don't think it needs any explanation just, set your domain there and be sure that you enable an endpoint on the following path " /g/collect" Consent Compliance If you feel it you could buy me some coffees to support my work, this time I'm even hosting a copy of the file myself to ease the work (which depending on the traffic may lead to some costs for me.Ĭopy GA4_ENDPOINT_HOSTNAME: "" ![]() ![]() The good news is that we've got all the needed pieces of information available to perform a fully working tracking with Google Analytics 4, including the session tracking and the needed switched to have the, first_visit, session_start, user_engagment events generated, and as an unexpected extra we'll be able to set event parameters and user properties within our events I'm open to receiving feedback from people that may end up trying this solution, which may not end up being perfect, but still is more than what we actually have. I've been testing everything I could and everything seems to be working fine. That's why I decided to investigate the possibilities of Component and APIs in order to try to build an AMP Native Tracking without needing to draw on some tricky methods like using the infamous iframes. While this may not be an issue for many sites, there're some website types that really need this support (like media sites or magazines). Is the lack of AMP ( Accelerated Mobile Pages) Pages tracking support. One of the most notorious misses on Google Analytics 4. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |