Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leighmcculloch/gascrolldepth.js
A Google Analytics plugin that measures engagement by tracking page scroll depth.
https://github.com/leighmcculloch/gascrolldepth.js
Last synced: 9 days ago
JSON representation
A Google Analytics plugin that measures engagement by tracking page scroll depth.
- Host: GitHub
- URL: https://github.com/leighmcculloch/gascrolldepth.js
- Owner: leighmcculloch
- License: other
- Archived: true
- Fork: true (robflaherty/scroll-depth)
- Created: 2015-07-31T02:38:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-03T15:04:16.000Z (over 2 years ago)
- Last Synced: 2024-10-19T13:25:06.200Z (24 days ago)
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 41
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license.md
Awesome Lists containing this project
README
# 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
```javascript
gascrolldepth.init();
```or with jQuery:
```javascript
$.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.9To 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](https://github.com/robflaherty/jquery-scrolldepth/blob/master/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.