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 333 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 Introduction

swup 4 is released  🎉  Check out the release notes and upgrade guide.


swup

npm version Bundle size npm downloads Test status License


Swup

Versatile and extensible page transition library for server-rendered websites.

FeaturesDemosPluginsThemesDocumentationDiscussions

Overview

Swup adds page transitions to server-rendered websites. It manages the complete page load lifecycle and smoothly animates between the current and next page. In addition, it offers many other quality-of-life improvements like caching, smart preloading, native browser history and enhanced accessibility.

Make your site feel like a snappy single-page app — without any of the complexity.

Features

  • ✏️ Works out of the box with minimal markup
  • ✨ Auto-detects CSS transitions & animations for perfect timing
  • 🔗 Updates URLs and preserves native browser history
  • 🏓 Manages the scroll position between pages and anchor links
  • 🚀 Uses a cache to speed up subsequent page loads
  • 📡 Offers hooks to customize and extend the page load lifecycle
  • 🔌 Has a powerful plugin system and many official and third-party plugins
  • 🎨 Provides ready-to-go themes to get started quickly

Demos

Explore our interactive demos to see swup in action.

Documentation

Visit our official documentation to learn more.

Plugins

Swup is small by design. Extended features can be added via plugins:

Check out the list of official plugins and third-party integrations.

Themes

Get started quickly with one of three official themes: fade, slide, and overlay.

Examples

Take a look at the interactive demos and sites using swup for more examples.

Having trouble?

If you're having trouble implementing swup, check out the Common Issues section of the docs, look at closed issues or create a new discussion.

Want to Contribute?

We're looking for maintainers!   👀

Become a sponsor on Open Collective or support development through GitHub sponsors.

This project is tested with BrowserStack.

ga-plugin's People

Contributors

daun avatar dependabot[bot] avatar gmrchk avatar hirasso avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ga-plugin's Issues

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);

gtag.js

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

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!

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?

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.