- πΊπΈUnited States japerry KVUO
With the sunset of legacy google analytics, the 8.x-2.x module is now unsupported. If this is still an issue with the 4.x version, please file a new issue in the queue.
We recently realized after noticing high differences between analytics reports with and without user id enabled, that the id hash is being cached in the page content.
The result is a high number of sessions in the analytics report (ie one session per page viewed), and wrong user counts. This could have privacy implications too as the anonymized id is being leaked to unconcerned users.
Below is the current workaround I'm using, adding user to the cache contexts. It is probably not ideal because afaik it kind of defeats the whole purpose of the cache. I think it should be possible to use placeholder rendering to invalidate only the actual snippet, but it would have to be confirmed by someone with a better understanding of the d8 render array...
piwik / matomo are potentially affected too
--- a/google_analytics.module
+++ b/google_analytics.module
@@ -64,6 +64,7 @@ function google_analytics_page_attachments(array &$page) {
// Add module cache tags.
$page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags());
+ $page['#cache']['contexts'] = Cache::mergeContexts(isset($page['#cache']['contexts']) ? $page['#cache']['contexts'] : [], ['user']);
// Get page http status code for visibility filtering.
$status = NULL;
Closed: outdated
2.4
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
With the sunset of legacy google analytics, the 8.x-2.x module is now unsupported. If this is still an issue with the 4.x version, please file a new issue in the queue.