Issue with page views and other analytics data not capturing relating to consent banner | Community
Skip to main content
Level 3
November 1, 2024
Question

Issue with page views and other analytics data not capturing relating to consent banner

  • November 1, 2024
  • 2 replies
  • 1479 views

The problem: when visitors first come to our site, with no cookie banner interaction, the initial page view and some other analytics data items are not getting captured or tracked. This seems to be because the GPLR happens on a “window loaded” event type which needs the adobedtm tag to load instantly. Well the adobedtm tag is blocked until a user consents to analytics cookies. So if the banner is accepted, but the GPLR has already been triggered, almost nothing is tracked on that first page view.

 

My potential fix, that did work to some extent, was to add another GPLR that used custom Javascript which would add an event listener to the cookie banner’s acceptance. If the banner was accepted or analytics were accepted on that first page view, then the GPLR would basically refire. This worked flawlessly with my testing. But when things were published to Production, we saw a different outcome. My only guess to this would be variances to certain users with slower internet speeds and the 2nd GPLR not getting recognized or firing in time. I attempted to enhance the script with some timeout delays to account for this, but nothing seemed to match the outcome of what I was experiencing of my personal testing of the new addition.

 

What are recommended approaches to making sure all data is captured on that first page view, after a user has accepted cookies?

2 replies

KumarRishii
Level 5
June 27, 2025

Hi @mmasonwd 

Configure the tag to load immediately after consent is granted, prioritizing its activation and Use an event listener on the cookie banner to trigger analytics tracking with initial page context upon consent acceptance.

kautuk_sahni
Community Manager
Community Manager
June 30, 2025

@mmasonwd Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni