GA php code not working
-
I just don’t see what I’m doing wrong.
I bought Code Snippets so I don’t have to use all kind of plugins anymore (and ofcourse no child theme). But I can’t get the Google Analytics code to work.
I added a new php snippet with this code.
add_action( 'wp_head', 'wpb_add_googleanalytics' ); function wpb_add_googleanalytics() { ?> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-Y2ZYXN458M"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Y2ZYXN458M'); </script> <?php }why isn’t it working and show up information in analytics.google.com
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘GA php code not working’ is closed to new replies.