{"id":21188100,"url":"https://github.com/dev1an/analytics","last_synced_at":"2025-03-14T20:24:10.901Z","repository":{"id":90134564,"uuid":"46432711","full_name":"Dev1an/Analytics","owner":"Dev1an","description":"Simple meteor analytics","archived":false,"fork":false,"pushed_at":"2015-12-02T20:54:50.000Z","size":11,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T13:09:22.808Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dev1an.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-18T16:44:19.000Z","updated_at":"2020-03-25T23:46:20.000Z","dependencies_parsed_at":"2023-03-14T01:00:30.661Z","dependency_job_id":null,"html_url":"https://github.com/Dev1an/Analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FAnalytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FAnalytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FAnalytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FAnalytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dev1an","download_url":"https://codeload.github.com/Dev1an/Analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243640673,"owners_count":20323704,"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-20T18:42:35.023Z","updated_at":"2025-03-14T20:24:10.880Z","avatar_url":"https://github.com/Dev1an.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Analytics\r\nSee it in action on [simpleanalytics.meteor](http://simpleanalytics.meteor.com)\r\n\r\n## Features\r\n- Uses websockets to track visitors\r\n- Saves the IP address of the visitor\r\n- Seamlessly integrates with the accounts-base package to track logged in users.\r\n- Tracks the visitor's behavior using events\r\n\r\n# Usage\r\nWhen the package is added every DDP connection will be logged in a mongo collection: `Analytics.connections`.\r\nA connection contains information about the socket along with some additional information.\r\n- **id**: String  \r\nThe [meteor connection id](http://docs.meteor.com/#/full/meteor_onconnection)\r\n- **address**: String  \r\n  The visitor's IP address\r\n- **geoData**: Object  \r\n  Geospatial data based on the visitors IP address\r\n  - **country**: String  \r\n    2 letter [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) country code\r\n  - **region**: String  \r\n    2 character region code.  For US states this is the 2 letter [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2#Current_codes) subcountry code for other countries, this is the [FIPS 10-4](https://en.wikipedia.org/wiki/List_of_FIPS_region_codes) subcountry code\r\n  - **city**: String  \r\n    This is the full city name\r\n  - **ll**: [Number]  \r\n    The latitude and longitude of the city\r\n- **userAgent**: String  \r\n  The user agent that was sent un the HTTP header\r\n- **startDate**: Date \u003cbr\u003e The moment the visitor initiated the web socket connection\r\n- **endDate**: Date \u003cbr\u003e The moment the visitor closed the web socket\r\n- **events**: [Event] \u003cbr\u003e An array containing client-side events like 'window.blur' and 'widow.focus'. An Event looks like this\r\n  - **name**: String \u003cbr\u003e Event name (for example: 'blur' or 'focus')\r\n  - **date**: Date \u003cbr\u003e The moment the event was triggered\r\n  - **data**: Object *optional* \u003cbr\u003e Some data about the event\r\n\r\nThe events array is a lazy loaded query on the `Analytics.events` collection. If you want a reactive datasource you should use the `eventsCursor` property of a connection, this returns a mongo cursor to the same data.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev1an%2Fanalytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev1an%2Fanalytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev1an%2Fanalytics/lists"}