{"id":21077998,"url":"https://github.com/ryanburnette/google-analytics-scroll-events","last_synced_at":"2025-03-14T04:12:10.457Z","repository":{"id":71534342,"uuid":"122674772","full_name":"ryanburnette/google-analytics-scroll-events","owner":"ryanburnette","description":null,"archived":false,"fork":false,"pushed_at":"2018-02-23T23:40:31.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T23:16:23.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanburnette.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-23T21:30:55.000Z","updated_at":"2018-02-23T22:46:19.000Z","dependencies_parsed_at":"2023-03-21T13:06:50.466Z","dependency_job_id":null,"html_url":"https://github.com/ryanburnette/google-analytics-scroll-events","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanburnette%2Fgoogle-analytics-scroll-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanburnette%2Fgoogle-analytics-scroll-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanburnette%2Fgoogle-analytics-scroll-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanburnette%2Fgoogle-analytics-scroll-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanburnette","download_url":"https://codeload.github.com/ryanburnette/google-analytics-scroll-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521288,"owners_count":20304187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T19:39:06.110Z","updated_at":"2025-03-14T04:12:10.431Z","avatar_url":"https://github.com/ryanburnette.png","language":"JavaScript","readme":"# Google Analytics Scroll Events\n\nA browser JavaScript library for binding Google Analytics events to the window\nscrolling to an element. \n\n## Use Case\n\nI often have clients make requests to build elements that reduce the height of\na page. In many cases I suspected that most users were willing to scroll which\nmade the element superfluous. If users are willing to scroll to some content\nfurther down the page, what's the point of adding complexity to move content\ncloser to the top?\n\nThis lets you create data on how often a user scrolls to a certain point in the\ncontent.\n\n## Usage\n\n```\nnpm install google-analytics-scroll-events\n```\n\n```javascript\nconst addEvent = require('google-analytics-scroll-events')\n\naddEvent('Body',1,'body')\naddEvent('Foo Element',2,'.foo')\naddEvent('Bar Element',3,'#bar')\n```\n\n## API\n\n### `createGoogleAnalyticsScrollEvent(label,value,selector)`\n\nAdds an event which will fire when the window scrolls past the selected\nelement. Events only fire once.\n\n- `label` A label that will be used as a key for JavaScript objects and as the\n\t`eventLabel` in the Google Analytics event\n- `value` The `eventValue` in the Google Analytics event\n- `selector` A selector to be used by `document.querySelector` for the element\n\tthat must be scrolled to in order to fire the Google Analytics event\n\nRefer to the [documentation for Google Analytics events][1].\n\n[1]: https://developers.google.com/analytics/devguides/collection/analyticsjs/events\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanburnette%2Fgoogle-analytics-scroll-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanburnette%2Fgoogle-analytics-scroll-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanburnette%2Fgoogle-analytics-scroll-events/lists"}