Google Analytics 4 how to send custom event with Zaraz

Hi, I have this script, can we implement it Zaraz?

<script>
    window._pwGA4PageviewId = ''.concat(Date.now());
    window.dataLayer = window.dataLayer || [];
    window.gtag = window.gtag || function () { 
      dataLayer.push(arguments);
    };
    gtag('js', new Date());
    gtag('config', '{your GA4 ID}', { 'send_page_view': false });
    gtag(
      'event',
      'ramp_js',
      {
        'send_to': '{your GA4 ID}',
        'pageview_id': window._pwGA4PageviewId
      }
    );
</script>
1 Like