{"id":13547901,"url":"https://github.com/lukeed/ganalytics","last_synced_at":"2025-10-09T18:23:59.848Z","repository":{"id":46884857,"uuid":"98074061","full_name":"lukeed/ganalytics","owner":"lukeed","description":"A tiny (312B) client-side module for tracking with Google Analytics","archived":false,"fork":false,"pushed_at":"2023-03-16T16:47:09.000Z","size":38,"stargazers_count":575,"open_issues_count":4,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-19T08:34:17.441Z","etag":null,"topics":["analytics","google-analytics","javascript","lightweight"],"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/lukeed.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}},"created_at":"2017-07-23T04:16:59.000Z","updated_at":"2025-09-09T18:53:14.000Z","dependencies_parsed_at":"2024-02-04T16:19:47.640Z","dependency_job_id":"6d6c925b-9a00-4efa-bf9e-8ae74a4fe512","html_url":"https://github.com/lukeed/ganalytics","commit_stats":{"total_commits":58,"total_committers":3,"mean_commits":"19.333333333333332","dds":0.03448275862068961,"last_synced_commit":"4593ec601c5f1f83c61804fa3e868713fbaedf0b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/ganalytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fganalytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fganalytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fganalytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fganalytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/ganalytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fganalytics/sbom","scorecard":{"id":604468,"data":{"date":"2025-08-11","repo":{"name":"github.com/lukeed/ganalytics","commit":"4593ec601c5f1f83c61804fa3e868713fbaedf0b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 2/25 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":"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":"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 9 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-21T01:15:41.582Z","repository_id":46884857,"created_at":"2025-08-21T01:15:41.582Z","updated_at":"2025-08-21T01:15:41.582Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001940,"owners_count":26083226,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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","google-analytics","javascript","lightweight"],"created_at":"2024-08-01T12:01:02.935Z","updated_at":"2025-10-09T18:23:59.820Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","readme":"# ganalytics [![Build Status](https://travis-ci.org/lukeed/ganalytics.svg?branch=master)](https://travis-ci.org/lukeed/ganalytics)\n\n\u003e A tiny (312B) client-side module for tracking with Google Analytics\n\nThis module exposes three module definitions:\n\n* **ES Module**: `dist/ganalytics.mjs`\n* **CommonJS**: `dist/ganalytics.js`\n* **UMD**: `dist/ganalytics.min.js`\n\n_Please see [Releases](https://github.com/lukeed/ganalytics/releases) for changelog!_\n\n\n## Install\n\n```\n$ npm install --save ganalytics\n```\n\n\n## Usage\n\n```js\nconst GAnalytics = require('ganalytics');\n\nconst ga = new GAnalytics('UA-XXXXXXXX-X', { aid:1 });\n// or\nconst ga = GAnalytics('UA-XXXXXXXX-X', { aid:1 });\n\nga.send('pageview');\nga.send('pageview', { dt:'Foobar', dp:'/foo' });\n\nga.send('event', { ec:'Video', ea:'Play', el:'Home Hero' });\n```\n\n\n## API\n\n### GAnalytics(trackerID, options, toWait)\n\n#### trackerID\nType: `String`\n\nYour Google Analytics tracker ID; eg `UA-XXXXXXXX-X`\n\n#### options\nType: `Object`\n\nAny common, [general options](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#general) that this instance should hold onto.\n\n\u003e **Note:** Any `option` key can be redefined or overwritten within a `send()` call.\n\n#### options.aip\nType: `Integer`\u003cbr\u003e\nDefault: `0`\n\nAnonymize the sender's IP address. See [Anonymize IP](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aip).\n\n#### options.an\nType: `String`\n\nSpecifies the application's name. See [Application Name](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#an).\n\n#### options.aid\nType: `String`\n\nSpecifies the application identifier. See [Application ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aid).\n\n#### options.aiid\nType: `String`\n\nSpecifies the application installer identifier. See [Application Installer ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aiid).\n\n#### options.av\nType: `String`\n\nSpecifies the application verison. See [Application Version](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#av).\n\n\n#### options.cid\nType: `String`\n\nAnonymously identify a particular user, device, or browser instance. This should be persisted so that repetitive session use the same identifier. See [Client ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid).\n\n\u003e **Important** This is required when `options.uid` is not defined.\n\n#### options.uid\nType: `String`\n\nAn identifier for a known user, if possible. This value should never be persisted. See [User ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid).\n\n\u003e **Important** This is required when `options.cid` is not defined.\n\n#### options.ds\nType: `String`\n\nIndicates the data source type of the hit; eg `web` or `app`. See [Data Source](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ds).\n\n#### toWait\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nWhen truthy, a `pageview` event **will not** be sent immediately upon initialization.\n\n\n### ga.send(type, params)\n\n#### type\nType: `String`\n\nThe type of hit to send. Must be one of these: `pageview`, `screenview`, `event`, `transaction`, `item`, `social`, `exception`, or `timing`.\n\n#### params\nType: `Object`\n\nThe parameters to send based on the `type` of hit.\n\nPlease follow the links for each available parameter set:\n\n* [Event](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#events)\n* [Exception](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#exception)\n* [Item](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ecomm)\n* [Pageview](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#content)\n* [Screenview](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cd)\n* [Social](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#social)\n* [Timing](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#timing)\n* [Transaction](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ecomm)\n\nFor `pageview` hits _only_, if no `params` are provided, then the `document.title` and `location.href` values will be auto-filled. This allows you to send valid requests by writing:\n\n```js\nga.send('pageview');\n// is the same as:\n//=\u003e ga.send('pageview', { dt:document.title, dl:location.href })\n```\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fganalytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fganalytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fganalytics/lists"}