Coder Social home page Coder Social logo

swup / ga-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 395 KB

A swup plugin for integrating Google Analytics 📈

Home Page: https://swup.js.org/plugins/google-analytics-plugin

License: MIT License

JavaScript 100.00%
swup plugin google-analytics page-transitions analytics ga

ga-plugin's Issues

Doesn't support new Global Site Tag (gtag.js) tracking

The new recommended google analytics tracking code uses a different syntax.

We've update our site manually to run the following on transition complete:

gtag('config', '<TRACKING CODE>', {
	'page_title' : document.title,
	'page_path': window.location.pathname + window.location.search
});

I would suggest an update that checks for the presence of either configuration for backwards compatibility.

Do you accept PRs?

Selecting the tracking ID

window.ga("set","title",n)

Was returning an undefined javascript error.

If you're initializing Google Analytics with google tag manager, this might work for you– it solved the problem for me:

var trackingID = window.ga.getAll()[0].get('name');
window.ga(trackingID + ".set","title",n);

Issue installing via NPM using 3.0.5

Hey guys,
I was finishing my project ( started long time ago), and now I'm facing this issue.
I can't install the plugin with 3.0.5 version.

Captura de pantalla 2023-08-02 a las 23 27 46

Any suggestion? I do not want to migrate to v4 yet. using node v19.8.1

Thanks in advance!

gtag.js

Is it work with gtag.js? analytics.js is the old way to track your website

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.