Skip to main content

Board View GA4 implementation via GTM

  • March 25, 2024
  • 5 replies
  • 360 views

Hello, I tried to implement Google Analytics 4 via Google Tag Manager in my app. But it is sends almost 0 hits to GA4.

I’m also using dataLayer to to capture important data about current page.

Any advice, solution or recommend way?

Thank you.

5 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 25, 2024

Hello there @marekd and welcome to the community!

Would you be able to please fill this form so our team can take a look into this? Please add as much detail about your case as possible.

Looking forward to hearing from you via the form!

Cheers,
Matias


dvdsmpsn
Forum|alt.badge.img+1
  • Participating Frequently
  • March 25, 2024

@marekd @Matias.Monday

It’s likely that using GA4 via GTM does not set cookies correctly in an iframe.

Have you specified Cookies Having Independent Partitioned State (CHIPS)?

You’ll probably need to set cookie flags as follows:

SameSite=None;Secure;Partitioned

If you can’t do that in GTM, then you’ll have to use the standard GA4 script and the cookie_flags option instead.

Something similar to this:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXX', {
    cookie_flags: 'SameSite=None;Secure;Partitioned'
  });
</script>

Repace G-XXXXX in both places with your tracking code


  • Author
  • New Participant
  • March 26, 2024

Thank you @dvdsmpsn ! Will test it and get back with results.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 27, 2024

Thank you @dvdsmpsn for the suggestion!!


  • Author
  • New Participant
  • April 4, 2024

This worked like a charm. Thank you David!