fvosberg
fvosberg

Reputation: 697

How can I debug Google Analytics 4 events, that are missing in the debug view

i'm fairly new to Google Analytics and I'm starting with the new Google Analytics 4. I've set it up via Google Tag Manager.

I have two custom events:

When I debug my page with the https://tagassistant.google.com/, I can see both events beeing triggered.

In the debug view of Google Analytics, the cta_visible event is displayed, the click_meeting_link is missing. I thought, that it's maybe a bug, caused by the fact, that as I'm clicking the link, my browser is leaving the page.

But I can see the event cta_visible in my reports, click_meeting_link is also missing there.

In the network tab I see both events being sent to GA (with a response code of 204).

curl 'https://www.google-analytics.com/g/collect?v=2&tid=G-NKBZG0FK64&gtm=2oead0&_p=1988538019&sr=1792x1120&gcs=G100&gdid=dOThhZD&ul=en-gb&cid=1495603155.1634555573&_s=5&dl=https%3A%2F%2Finnovation.tarent.de%2Fsparring&dt=Innovation%20Sparring%20%7C%20tarent&sid=1634555572&sct=1&seg=0&en=click_meeting_link&_c=1&_et=2&ep.debug_mode=true&ep.click_url=https%3A%2F%2Fmeetings.hubspot.com%2Ffrederik-vosberg%2Finnovation-sparring' \
  -X 'POST' \
  -H 'authority: www.google-analytics.com' \
  -H 'content-length: 0' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'sec-ch-ua: "Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'content-type: text/plain;charset=UTF-8' \
  -H 'accept: */*' \
  -H 'origin: https://innovation.tarent.de' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: no-cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://innovation.tarent.de/' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7' \
  --compressed



  curl 'https://www.google-analytics.com/g/collect?v=2&tid=G-NKBZG0FK64&gtm=2oead0&_p=1800931673&sr=1792x1120&gcs=G100&ul=en-gb&cid=175794657.1634555667&_s=2&dl=https%3A%2F%2Finnovation.tarent.de%2Fsparring&dt=Innovation%20Sparring%20%7C%20tarent&sid=1634555666&sct=1&seg=0&en=cta_visible&_fv=1&_nsi=1&_ss=1&_eu=C&ep.debug_mode=true' \
  -X 'POST' \
  -H 'authority: www.google-analytics.com' \
  -H 'content-length: 0' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'sec-ch-ua: "Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'content-type: text/plain;charset=UTF-8' \
  -H 'accept: */*' \
  -H 'origin: https://innovation.tarent.de' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: no-cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://innovation.tarent.de/' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7' \
  --compressed

Any suggestions, what can cause this?

Thanks in advance

Upvotes: 0

Views: 4094

Answers (2)

fvosberg
fvosberg

Reputation: 697

I've found the problem: The Consent Management Platform usercentrics activated the new Google Consent Mode. We didn't configure it properly, so analytics tracking was denied. This added the gcs:G100 parameter to the request, which tells Google Analytics to ignore it.

This prevented also that the DebugView works properly.

Upvotes: 2

BNazaruk
BNazaruk

Reputation: 8081

I don't see anything wrong in the network requests. They look perfectly fine. This data should be accessible in GA4.

But if you don't see the other event in GA4, I only can presume the event is not created in GA4. GA4 limits the number of unique events that you can create ( https://support.google.com/analytics/answer/9267744?hl=en ). Even though the limit is quite allowing, it's still a fitting security measure to not create them on the fly.

Also, you don't need to preserve log. It's usually just easier to prevent the page from reloading by executing this in the local console:

window.onbeforeunload = function(){return false;}

Upvotes: 0

Related Questions