{"id":17809282,"url":"https://github.com/codfish/jquery-track","last_synced_at":"2026-05-01T02:32:08.742Z","repository":{"id":13028993,"uuid":"15708614","full_name":"codfish/jquery-track","owner":"codfish","description":"Bind google analytics events to DOM elements easily using HTML data attributes.","archived":false,"fork":false,"pushed_at":"2021-04-26T11:31:29.000Z","size":116,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-16T21:40:52.393Z","etag":null,"topics":["analytics","events","fish","google-analytics","javascript","jquery","jquery-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codfish.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}},"created_at":"2014-01-07T15:43:57.000Z","updated_at":"2022-07-14T20:36:27.000Z","dependencies_parsed_at":"2022-09-18T23:22:57.545Z","dependency_job_id":null,"html_url":"https://github.com/codfish/jquery-track","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/codfish/jquery-track","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fjquery-track","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fjquery-track/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fjquery-track/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fjquery-track/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codfish","download_url":"https://codeload.github.com/codfish/jquery-track/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codfish%2Fjquery-track/sbom","scorecard":{"id":298085,"data":{"date":"2025-08-11","repo":{"name":"github.com/codfish/jquery-track","commit":"09a1500d9d106a88559f43a2bba0c413c0df7426"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T20:01:35.998Z","repository_id":13028993,"created_at":"2025-08-17T20:01:35.998Z","updated_at":"2025-08-17T20:01:35.998Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["analytics","events","fish","google-analytics","javascript","jquery","jquery-plugin"],"created_at":"2024-10-27T15:16:18.051Z","updated_at":"2026-05-01T02:32:08.699Z","avatar_url":"https://github.com/codfish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jquery-track\n\nBind google analytics events to DOM elements easily using HTML data attributes.\n\n[![Build Status](https://travis-ci.org/codfish/jquery-track.svg?branch=master)](https://travis-ci.org/codfish/jquery-track) [![Code Climate](https://codeclimate.com/github/codfish/jquery-track/badges/gpa.svg)](https://codeclimate.com/github/codfish/jquery-track) [![npm](https://img.shields.io/npm/v/jquery-track.svg)](http://npmjs.org/package/jquery-track)\n\n## Installation\n\n* [yarn](https://yarnpkg.com/en/package/jquery-track): `yarn add jquery-track`\n* [npm](http://npmjs.org/package/jquery-track): `npm install --save jquery-track`\n* [unpkg](https://unpkg.com) cdn: [minified](https://unpkg.com/jquery-track/dist/jquery.track.min.js) or [unminified](https://unpkg.com/jquery-track/dist/jquery.track.js)\n* [jsdeliver](http://www.jsdelivr.com/) cdn: [minified](https://cdn.jsdelivr.net/npm/jquery-track@latest/dist/jquery.track.min.js) or [unminified](https://cdn.jsdelivr.net/npm/jquery-track@latest/dist/jquery.track.js)\n* [Download the latest release on Github](https://github.com/codfish/jquery-track/releases)\n\n## Usage\n\nBasic example using `data-` attributes:\n\n```html\n\u003ca href=\"/\"\n    data-event-category=\"Site Navigation\"\n    data-event-action=\"click\"\n    data-event-label=\"Home\"\u003eHome\u003c/a\u003e\n```\n\n```js\n// initialize the plugin\n$('a').track();\n```\n\n### Data attributes\n\nThe following data attributes are available, most of which map directly to [GA event fields](https://developers.google.com/analytics/devguides/collection/analyticsjs/events#event_fields).\n\n- `data-event-category` maps to the `eventCategory` GA field. **Required**.\n- `data-event-action` maps to the `eventAction` GA field. **Required**.\n- `data-event-label` maps to the `eventLabel` GA field. _Optional_, defaults to `null`.\n- `data-event-value` maps to the `eventValue` GA field. _Optional_, defaults to `null`.\n- `data-non-interation` maps to the `nonInteraction` GA field. _Optional_, defaults to `false`.\n- `data-transport` maps to the `transport` GA field. _Optional_, defaults to `null`.\n- `data-event-type` is the event types you want to trigger the event on. _Optional_, defaults to `click`. Can be any DOM event type that is [supported by jQuery](http://api.jquery.com/Types/#Event), as well as custom events.\n- `data-hit-type` maps to the `hitType` GA field. _Optional_, defaults to `event`. Can **only** be `event` or [`social`](https://developers.google.com/analytics/devguides/collection/analyticsjs/social-interactions).\n\nFurther details about the meaning of these fields can be [found in the Google Analytics documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/events).\n\n## Plugin options\n\n#### debug {Boolean} _Default:_ `false`\n\nSet to true to turn on debug mode. Events will get logged to the browser console, instead of being sent to GA.\n\n```js\n$('a').track({ debug: true });\n```\n\n#### social {Boolean} _Default:_ `false`\n\nSet to true if you're tracking a [social event]().\n\n```html\n\u003ca href=\"#\"\n    data-event-category=\"Twitter\"\n    data-event-action=\"tweet\"\n    data-event-label=\"http://codfish.io\"\u003eTweet\u003c/a\u003e\n```\n\n```js\n$('a').track({ social: true });\n```\n\nAlternatively, you can use the `data-hit-type` attribute if you don't want to use the option, or you have a mixture of non-social \u0026 social elements you're tracking.\n\n```html\n\u003ca href=\"#\"\n    data-hit-type=\"social\"\n    data-event-category=\"Twitter\"\n    data-event-action=\"tweet\"\n    data-event-label=\"http://codfish.io\"\u003eTweet\u003c/a\u003e\n```\n\n#### prefix {String} _Default:_ `''`\n\nUse this option to tell the plugin to grab field values from data attributes with this prefix, i.e. `data-{prefix}event-category`. This can help in the rare instance that you may have a naming conflict with a data attribute.\n\n```html\n\u003ca href=\"/\"\n    data-ga-event-category=\"Site Navigation\"\n    data-ga-event-action=\"click\"\n    data-ga-event-label=\"Home\"\u003eHome\u003c/a\u003e\n```\n\n```js\n$('a').track({ prefix: 'ga-' });\n```\n\n## Todo\n\n- [x] Add options\n- [x] Add umd during build process\n- [x] Add individual data attributes\n- [x] Add `transport: 'beacon'` support. https://developers.google.com/analytics/devguides/collection/analyticsjs/sending-hits#specifying_different_transport_mechanisms\n- [ ] Store each instance of the plugin as a dataset item, to help prevent re-initializing items.\n- [ ] Handle multiple event types, i.e. `data-event-type=\"load click\"`\n- [ ] Possibly refactor to handle all hit types, i.e. page/app tracking (`pageview`, `screenview`), ecommerce tracking (`transaction` or `item`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfish%2Fjquery-track","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodfish%2Fjquery-track","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfish%2Fjquery-track/lists"}