Google Maps and Analytics – unexpected results
-
Hi,
The Complianz plugin has let me know that it can’t find a Google Maps plugin even though we have Google Maps on our site. So in a private browser, before giving any consent, I went to a page that has a map, but I don’t see any Google Maps cookies. Does that mean some implementations of Google Maps do not use cookies and therefore do not require consent?
Meanwhile, I do see Google Analytics cookies. Are those allowed without consent?
Thanks for your help.
The page I need help with: [log in to see the link]
-
Hello @mcbsys,
Your site is configured for the United States, an ‘opt-out’ region. In such regions, non-functional cookies are not blocked when initially viewing the site; only after the visitor explicitly revokes their consent on the Opt-out Preferences page.
If you were to configure the plugin for an ‘opt-in’ region (such as the European Union), such tools would indeed have to be blocked before the user consents to the corresponding categories in the Cookie Banner.
I hope this clarifies, but let us know if we can assist.
Kind regards, Jarno
Thank you, Jarno. That does explain the principle.
So in the Private browser, I went to the opt-out page and opted out of both Statistics and Marketing cookies. This added six functional cookies from Complianz, so I can see that it worked, but the Google Analytics (_ga) cookies are still there. Why is that? Hmm… I see that the _ga domain is “.pbumc.org” but the cmplz_* domain is “www.pbumc.org”.
Also, why do I not see cookies from Google Maps even on the page with a map displayed?
Regards,
Mark
Hi @mcbsys,
The GA script is set to
<script type="text/plain" data-service="google-analytics" data-category="statistics" data-cmplz-src="//www.googletagmanager.com/gtag/js?id=UA-***-1" data-cfasync="false" data-wpfc-render="false" async=""></script>
when consent is revoked.type="text/plain"
means the script is not longer available, the cookies are therefore ‘unusable’ as they are set on your domain, but can’t be used.Removing cookies from a user’s browser is not a default, but you can do this if you’d like by enabling the CookieShredder, under Wizard – Consent – Services, first question. https://complianz.io/introducing-the-cookieshredder/
Or use an MU plugin; https://github.com/Really-Simple-Plugins/complianz-integrations/blob/master/Cookies/clear-cookies-on-revoke.php
regards Aert
- This reply was modified 1 year, 9 months ago by Aert Hulsebos. Reason: wrapped code and removed 'nulled' as a word, might cause mod trigger
Thank you, Aert. That makes sense, and tells me what to look for. However it’s doesn’t match the behavior I am seeing. With CookieShredder turned off, in a new Private window:
- Browse to https://www.pbumc.org. Don’t consent yet. View Source and search for
data-service="google-analytics"
. It occurs three times; all are set to text/plain. So even though consent in the U.S. is implied per Jarno’s reply above, the scripts are not enabled. - Click Accept on the Complianz popup and re-open View Source. All three Analytics script blocks are still text/plain, so consenting does not enable the scripts.
I do have Malwarebytes BrowserGuard installed, but it is not active in Private sessions, so it should not be blocking tracking.
Can you duplicate this? Is this somehow related to server-side caching?
Regards,
Mark
Hi @mcbsys,
The page source never changes, you have to look at the updated HTML in your console to see the difference.
Complianz will manage all scripts that need consent by setting them to text/plain and releasing them based on the user’s settings.
In the US this would mean the scripts are set to text/plain, then immediately released when the consent settings are loaded. The reasoning is that the user might previously have revoked consent. This will be saved in the cookie we set, if revoked the scripts won’t get released.
This can be seen in the console – elements. The page source won’t change.
Hope this makes sense,
regards AertThank you, Aert. I appreciate your patience in explaining these behaviors.
It seems this gets even more complicated in Firefox, which has a built-in blocker for Private windows. Even after adding an exception, Google Analytics and Tags get “shimmed,” making it harder to see what happens with Complianz. But I see what you are describing when I use Chrome Incognito.
Meanwhile, back to the original question: on https://www.pbumc.org/locations/pbumc/, I see five scripts related to Google Maps but no cookies. So I’m okay to ignore the Complianz warning about Google Maps?
Hi @mcbsys,
Even though Google Maps doesn’t necessarily set any cookies, personal data (at least the IP addresses) might still be processed & stored when using the Google Maps API (read more here).
Luckily, we already have an integration with your exact Google Map implementation (for the “Saved” theme by ChurchThemes), which you can apply in case you would like to block this Map when consent is revoked: https://complianz.io/churchthemes-google-maps/
Kind regards, Jarno
Hi Jarno,
That’s great that there is already a plugin for this case! However I seem to have an issue with the plugin when viewing https://www.pbumc.org/locations/pbumc/.
In a Firefox Private window, after clearing the server cache, I saw the message over the map one time. When I clicked on it to accept marketing cookies, the map area became solid white. Now it just stays solid white, even after accepting cookies at the main Complianz popup. In a Chrome Incognito window, it opens as just white space and stays that way after clicking Accept in the main popup.
I will leave the mu plugin installed if you want to try it.
Thanks for your advice on this!
Mark
Hi @mcbsys,
It looks like there’s one Maps script that isn’t currently blocked by the integration yet, so it throws a “google is not defined” error and the Map is likely unable to load as a result of that.
I unfortunately can’t find the Saved theme anymore to test it myself, but I have updated the integration based on the behavior I saw on your page. Could you change the current MU Plugin on your site with the below version?
Hope it helps! Kind regards, Jarno
Jarno,
Thanks for that update. I’ve installed it under mu-plugins. Unfortunately, “google” is still undefined when it is referenced in line 27 of the script. I set a breakpoint at the top of that function, temporarily disabled Complianz and found that google _is_ defined. So somehow it is supposed to be defined (as a global variable, I assume) before this function is called.
“ctfw” stands for Church Themes Framework. The maps.js script that is throwing the error is here, if that helps: https://github.com/churchthemes/church-theme-framework/blob/master/js/maps.js.
Do you see an obvious fix or should I contact the theme developer?
Regards,
Mark Berry
Hi @mcbsys,
I expected my previous change to correctly block that “maps.js” script, but as it didn’t seem to find the script yet, I have made one further adjustment to the integration.
Please find the updated version here: https://github.com/Really-Simple-Plugins/complianz-integrations/blob/churchthemes-saved/Google%20Maps/churchthemes-gmaps.php
You may also send us a message via support(at)complianz.io if you’d like us to take a closer look.
Kind regards, Jarno
Thank you, Jarno. Here is the behavior I see after updating the mu-plugin again:
- On first load in a Private window, the map is displayed. Probably okay in the U.S., where opt-in is assumed until you opt out.
- After going to the opt-out page and unchecking Marketing, the map is behind a “Click to accepting marketing cookies” box.
- After clicking the box to accept, the map disappears; a white background is displayed.
- After refreshing the page, the map re-appears without an opt-in box.
So it looks like it’s working! Could the map be re-displayed without having to refresh the page?
Thanks for all your help!
Hi @mcbsys,
You can contact us directly via support(at)complianz.io for a closer look at the ChurchThemes Google Map integration.
Kind regards, Jarno
Just wanted to close this out. I think I will leave it as is–hopefully most visitors will be coming back to the site, or at least be able to refresh the page, to see the map, so a temporary white space isn’t top priority to fix :).
Thanks very much for your help.
- The topic ‘Google Maps and Analytics – unexpected results’ is closed to new replies.