Conditional google analytics tag
-
Hello,
i would like to active this google tag only on 1 page the contact page(id=313)
but this isnt working:
<?php if ( is_page(313)) { echo '<script async src="https://www.googletagmanager.com/gtag/js?id=AW-346653908"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-346653908'); </script>';} endif; ?>can any one help please?
- This topic was modified 4 years, 10 months ago by . Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Conditional google analytics tag’ is closed to new replies.