MatteoGabriele / vue-gtag

Global Site Tag plugin for Vue (gtag.js)
https://matteo-gabriele.gitbook.io/vue-gtag/
MIT License
863 stars 66 forks source link

vue-gtag does not launch custom html tags #265

Closed alex-kowalczyk closed 3 years ago

alex-kowalczyk commented 3 years ago

Description

GTM does not send custom html tags. Reproduce by

Expected behavior

Google Tag should should send both Analytics tag and custom HTML tags

Actual behavior

Console and Network logs indicate that Google Analytics tag (like page view) is sent, but custom html tag is not fired - no loglines on console nor Ajax requests.

Tried that on Page View (All Pages) trigger, same as Analytics, and few others (DOM ready, Window loaded). Tag assistant also confirms the GTM tag is present, analytics sent, while does not discover any custom html tag.

Tag Assistant output

If you view tag script obtained by the site from google, html tags are there, so I'm pretty sure that's not google-side workspace or publishing problem.

gtag/js content with html tags

Environment

└── vue-gtag@1.10.0

Then, specify:

  1. Operating system: Ubuntu Linux 20.04
  2. Browser and version: Chromium Version 88.0.4324.96 (Official Build) snap (64-bit)

Tried with all ad-blockers and other relevant plugins (like dev tools, tag debuggers, etc) removed or disabled.

Reproducible Demo

Vue.use(VueGtagPlugin, {
    config: {id: '<ID-HERE>',},
    enabled: true
}
alex-kowalczyk commented 3 years ago

Underlying gtag.js does not support custom tags, only a fixed set of GA and few others. https://www.obilityb2b.com/blog/how-to-choose-between-google-tag-manager-and-global-site-tag/

For custom tags to work, gtm.js based plugin must be used instead (like vue-gtm).