Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Adding Google Analytics to app

Topic Labels: Custom Extensions
365 0
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I am trying to integrate Google Analytics through a global tag through react-helmet but no page views show up on Analytics.

The following code should trigger an automatic pageView on Google Analytics when the app initially loads, but it doesn’t.

<Helmet>
        <script
          async
          src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}
        />
        <script
          dangerouslySetInnerHTML={{
            __html: `
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());

            gtag('config', '${GA_MEASUREMENT_ID}');
          `,
          }}
        />
</Helmet>

I can see it loads properly, but no events are being registered on Analytics.

Is this allowed through an app? Would appreciate some direction, thanks!

0 Replies 0