Google Analytics Global Site Tag (gtag.js) for Facebook Instant Articles
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments)}; | |
gtag('js', new Date()); | |
gtag('set', 'page_title', 'FBIA: '+ia_document.title); | |
gtag('set', 'campaignSource', 'Facebook'); | |
gtag('set', 'campaignMedium', 'Social Instant Article'); | |
gtag('config', 'UA-XXXXXXXX-X'); | |
</script> |
This comment has been minimized.
This comment has been minimized.
Not working |
This comment has been minimized.
This comment has been minimized.
Not working here either. |
This comment has been minimized.
This comment has been minimized.
Same, not working |
This comment has been minimized.
This comment has been minimized.
Check this out: https://stackoverflow.com/questions/50231721/how-to-track-utm-source-in-google-analytics-using-gtag Do it this way: Or if you are doing this with the initial page view: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
@danielmcclure Does setting
campaignSource
like this actually works for you? Just tried to set those but no data is being registered in the Campaigns either way...