{"id":22092219,"url":"https://github.com/pirxpilot/google-ua","last_synced_at":"2025-06-26T10:04:04.588Z","repository":{"id":57202281,"uuid":"15093802","full_name":"pirxpilot/google-ua","owner":"pirxpilot","description":"Google Universal Analytics snippet","archived":false,"fork":false,"pushed_at":"2017-12-18T03:18:02.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-26T10:04:04.483Z","etag":null,"topics":[],"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/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-11T00:27:40.000Z","updated_at":"2019-07-17T20:25:30.000Z","dependencies_parsed_at":"2022-09-17T15:00:36.323Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/google-ua","commit_stats":null,"previous_names":["code42day/ua"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pirxpilot/google-ua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgoogle-ua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgoogle-ua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgoogle-ua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgoogle-ua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/google-ua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgoogle-ua/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262044447,"owners_count":23249749,"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-12-01T03:08:46.434Z","updated_at":"2025-06-26T10:04:04.564Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/google-ua.svg)](https://www.npmjs.com/package/google-ua)\n[![NPM version](https://img.shields.io/npm/l/google-ua.svg)](https://www.npmjs.com/package/google-ua)\n\n# google-ua\n\n  [Google Universal Analytics][gua] tracking snippet\n\n## Installation\n\n    $ npm install -S google-ua\n\n## API\n\n  Activate Google Analytics on the page and track page\n\n```javascript\nrequire('google-ua')(\"UA-XXXX-X\");\n```\n\n  Alternatively you can define ua property ID as a data attribute of document body\n\n```html\n\u003cbody data-ua-property-id=\"UA-XXXX-X\"\u003e\n```\n\n  Check [test/index.html](https://github.com/pirxpilot/google-ua/blob/master/test/index.html) for example.\n\n  Optional `fields` parameter lets you set [general tracker fields][fields] before the `pageview` event is sent.\n\n```javascript\nrequire('google-ua')(\"UA-XXXX-X\", {\n  anonymizeIP: true,\n  forceSSL: true,\n  userId: 'as8eknlll'\n});\n\n// set fields, retrieve property ID from data attribute of document body\nrequire('google-ua')({\n  anonymizeIP: true,\n  forceSSL: true,\n  userId: 'as8eknlll'\n});\n\n```\n\n  You can prevent snippet from sending `pageview` event automatically by setting the first parameter to false\n```javascript\n// initilize tracker, do not send `pageview` event\nrequire('google-ua')(false, \"UA-XXXX-X\")\n\n// initialize tracker, do not send `pageview` event, retrieve property ID from data attribute of document body\nrequire('google-ua')(false);\n\n```\n\n## License\n\n  MIT\n\n[gua]: https://support.google.com/analytics/answer/2790010?hl=en\n[fields]: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#general\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgoogle-ua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fgoogle-ua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgoogle-ua/lists"}