Giter Site home page Giter Site logo

vladmarchuk / gascrolldepth.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leighmcculloch/gascrolldepth.js

0.0 1.0 0.0 104 KB

A Google Analytics plugin that measures engagement by tracking page scroll depth.

License: Other

Shell 0.48% JavaScript 79.70% HTML 19.82%

gascrolldepth.js's Introduction

Scroll Depth

Scroll Depth is a Google Analytics plugin that tracks how far users are scrolling. The plugin provides native support for Universal Analytics, Classic Google Analytics, and Google Tag Manager. It can also be used with any analytics service that supports events.

This fork is maintained in parallel with Robert Flaherty's jquery-scrolldepth project, removing the dependence on jQuery.

Install

bower install gascrolldepth

Usage

gascrolldepth.init();

or with jQuery:

$.gascrolldepth();

Browser Compatibility

When specifying elements by their selector, browser compatibility is as follows, due to use of document.querySelector to find the element.

Browser Minimum Verison
Chrome 4
Firefox 3.5
Internet Explorer 8
Opera 10.1
Safari 3.1
iOS Safari 3.2
Opera Mini 8
Blackberry Browser 7
Opera Mobile 12
Chrome for Android 42
Firefox for Android 39
IE Mobile 10
UC Browser for Android 9.9

To expand browser compatibility to all effective browsers (IE 6+, Chrome 1+, Safari 1+, Firefox 2+, etc), you can:

  • include jQuery and all selectors supported by jQuery will be supported.
  • or, specify elements as an array of element IDs only, eg. #main and it will fallback to document.getElementById;
  • or, specify elements as an array of DOMElement objects rather than string selectors.

Contributing

Bug reports and code contributions are welcome. Please see contributing.md.

Testing

There's a test HTML file that mocks the Google Analytics functions and writes the GA Event data to the console.

License

Licensed under the MIT and GPL licenses.

gascrolldepth.js's People

Contributors

robflaherty avatar leighmcculloch avatar eddiecanales avatar sekimura avatar matiaskorhonen avatar aupajo avatar sspross avatar dingledow avatar

Watchers

Vladislav Marchuk avatar

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.