{"id":17049061,"url":"https://github.com/toddself/ga-collect","last_synced_at":"2025-04-30T17:43:31.490Z","repository":{"id":11822847,"uuid":"14375454","full_name":"toddself/ga-collect","owner":"toddself","description":"analytics.js library for node","archived":false,"fork":false,"pushed_at":"2013-11-13T21:02:15.000Z","size":128,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T12:22:20.212Z","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/toddself.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":"2013-11-13T20:25:54.000Z","updated_at":"2021-11-09T09:10:33.000Z","dependencies_parsed_at":"2022-09-26T18:10:41.983Z","dependency_job_id":null,"html_url":"https://github.com/toddself/ga-collect","commit_stats":null,"previous_names":["toddself/google-analytics"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fga-collect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fga-collect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fga-collect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fga-collect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toddself","download_url":"https://codeload.github.com/toddself/ga-collect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251753687,"owners_count":21638366,"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-10-14T09:53:46.495Z","updated_at":"2025-04-30T17:43:31.459Z","avatar_url":"https://github.com/toddself.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://secure.travis-ci.org/toddself/ga-collect.png)](http://travis-ci.org/toddself/ga-collect)\n\n#ga-collect\nA backend interface for the new version of Google Analytics, analytics.js, allowing you to proxy your events from your server rather than load the analytics code directly into the browser.\n\n##Installation\n`npm install ga-collect`\n\n##Usage\n```javascript\nvar GA = require('ga-collect');\nvar ga = new GA({urchin: 'UA-XXXXX-X'});\nga.pageview(\n  {\n    location: 'http://foobar.baz/a?b#c',\n    hostname: 'foobar.baz',\n    page: '/a',\n    title: 'Baz the Foo in the Bar!'\n  }, function(err){\n    if(err){\n      console.log(err);\n    }\n  });\n```\n\n##Methods\nThe keys for the event object passed into each function are the `Field Name` parameters from the [Analytics.js Field Reference](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference).\n\nThe following methods are supported, the callback is entirely optional. No success or failure message will be passed to it unless the server responds with a non 2XX status code:\n\n`#pageview(event, cb)`\n\n`#appview(event, cb)`\n\n`#event(event, cb)`\n\n`#transaction(event, cb)`\n\n`#item(event, cb)`\n\n`#social(event, cb)`\n\n**Note:** Social events *MUST* contain all three [social interaction](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#socialNetwork) parameters. If they are not provided, an error will be thrown.\n\n`#exception(event, cb)`\n\n`#timing(event, cb)`\n\n##Development\n```bash\ngit clone https://github.com/toddself/ga-collect\ncd ga-collect\nnpm install\n```\n\n##License \u0026 Copyright\nCopyright (c) 2013 Todd Kennedy, licensed under the [MIT License](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fga-collect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoddself%2Fga-collect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fga-collect/lists"}