Add google analytics tracking code to Dash App

I am trying to add Google Analytics tracking to a Dash Web Application. I reviewed other similar questions and followed the suggestion, however, I am running into an issue.

In my,

app = dash.Dash(....) 

        <!-- Global site tag (gtag.js) - Google Analytics -->
        <script async src=""></script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());

            gtag('config', 'G-XXXXXXXX');


SyntaxError: invalid syntax

How can I add GA tracking code in my Dash App?

Read more here:

Content Attribution

This content was originally published by kms at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: