Git Product home page Git Product logo

gridsome-plugin-gtag's Introduction

Gridsome Plugin to incorporate Google Tag

How to use

Install the plugin using

npm i gridsome-plugin-gtag

Put your Google Analytics ID in you environment variables with a name similar to GOOGLE_ANALYTICS_ID.

Then add the following to you gridsome.config.js plugins array

{
    use: 'gridsome-plugin-gtag',
    options: {
        config: {
            id: process.env.GOOGLE_ANALYTICS_ID,
        },
    },
},

Developed, Sponsored and Supported

threenine logo

gridsome-plugin-gtag's People

Contributors

garywoodfine avatar lejtzen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lejtzen osvaldom

gridsome-plugin-gtag's Issues

This doesn't work!

{
"name": "my-project",
"private": true,
"scripts": {
"build": "gridsome build",
"develop": "gridsome develop",
"explore": "gridsome explore"
},
"dependencies": {
"@gridsome/remark-prismjs": "0.5.0",
"@gridsome/source-filesystem": "^0.6.2",
"@gridsome/transformer-remark": "^0.6.4",
"gridsome": "^0.7.23",
"gridsome-plugin-gtag": "^0.1.10"
}
}

This package just plain doesn't work...

Outdated? / Usage with GA4

Tag manager would show null instead of the tag ID and I wouldn't get any events. Using vue-gtag@^1.10.0 (this is what this plugin currently depends on, as of writing, this resolves to 1.16.1) directly works, however, leading me to believe that this plugin needs some sort of update.

Here's how I went about using vue-gtag directly (in main.js):

import VueGtag from "vue-gtag";
// …
  Vue.use(VueGtag, {
    config: {
      id: 'G-XXXXXXXXXX',
    }
  })
// “inspired” by https://matteo-gabriele.gitbook.io/vue-gtag/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.