-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Better detect Ga3, Ga4, GTM and remove duplicate code and more tests #20381
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
Conversation
@sgiehl changed the caching to be be url. Tested it locally and worked, even for sites where no url is defined |
@tsteur One last thing just came to my mind. Is it on purpose that a detection of Google Analytics and similar is more important that the detection of a CMS like wordpress? If we detect GA3 for example, the no data screen will show the tracking code, with the note, that data from GA can be imported, even though the page might also be using wordpress and the information how to integrate it in wordpress might be more important. |
@sgiehl I had noticed this as well and found it a bit odd that the Integration page is hidden in that case. Since it would be more impactful to see the integration page in the case of WordPress rather than the GA link + tracking code. It may have actually reduced people starting to track. @bx80 do you remember or can check the original issue if that was on purpose? |
@tsteur I remember there was some discussion about whether the integration or tracking code tab should get priority when a consent manager was detected, as well as whether the UI would need changing to highlight both at once, but it didn't lead to anything definitive. In some cases the consent manager could be more important for getting tracking working than the CMS since most of the consent managers actively block all scripts on the site. I think the current logic is grouping the consent manager detection with GA3/GA4/GTM which isn't correct. The intention would have been: |
Description:
fix #20380
In Cloud we need to be able to detect the CMS of a site. As we currently already had two different logics for detecting websites in core and one in Cloud figured to refactor this slightly to only have one in core and then be able to reuse that one in Cloud.
It also adds more ways to detect GA/GTM and removes some of the private methods that were there into public methods so they can be tested. Was then able to remove some duplicate code in the controller.
Review