{"id":19230309,"url":"https://github.com/mrloop/ember-metrics-simple-analytics","last_synced_at":"2026-03-12T00:03:14.930Z","repository":{"id":65143514,"uuid":"581852512","full_name":"mrloop/ember-metrics-simple-analytics","owner":"mrloop","description":"Simple Analytics adapter for ember-metrics","archived":false,"fork":false,"pushed_at":"2024-10-25T15:57:09.000Z","size":1613,"stargazers_count":3,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-25T16:53:03.868Z","etag":null,"topics":["analytics","ember-addon","ember-metrics","metrics","simpleanalytics"],"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/mrloop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2022-12-24T15:35:00.000Z","updated_at":"2024-10-25T07:14:05.000Z","dependencies_parsed_at":"2023-09-22T15:06:11.274Z","dependency_job_id":"c61f58a4-4fe5-4cc8-9dbb-e0b62ab83478","html_url":"https://github.com/mrloop/ember-metrics-simple-analytics","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-metrics-simple-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-metrics-simple-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-metrics-simple-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrloop%2Fember-metrics-simple-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrloop","download_url":"https://codeload.github.com/mrloop/ember-metrics-simple-analytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223848258,"owners_count":17213597,"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":["analytics","ember-addon","ember-metrics","metrics","simpleanalytics"],"created_at":"2024-11-09T15:37:42.272Z","updated_at":"2026-03-12T00:03:14.902Z","avatar_url":"https://github.com/mrloop.png","language":"JavaScript","readme":"ember-metrics-simple-analytics\n==============================================================================\n\n[![CI](https://github.com/mrloop/ember-metrics-simple-analytics/actions/workflows/ci.yml/badge.svg)](https://github.com/mrloop/ember-metrics-simple-analytics/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/ember-metrics-simple-analytics.svg)](https://www.npmjs.com/package/ember-metrics-simple-analytics)\n\n\n\n[ember-metrics](https://github.com/adopted-ember-addons/ember-metrics) adapter for [Simple Analytics](https://simpleanalytics.com/)\n\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v3.28 or above\n* Embroider or ember-auto-import v2\n* ember-metrics v2\n\n\nInstallation\n------------------------------------------------------------------------------\n\n```sh\nember install ember-metrics-simple-analytics\n```\n\n\nConfiguration\n------------------------------------------------------------------------------\n\nTo setup, you should first configure the service through `config/environemnt`:\n```js\nmodule.exports = function (environment) {\n  var ENV = {\n    metricsAdapters: [\n      {\n        name: 'SimpleAnalytics',\n        environments: ['production'],\n      }\n    ]\n  }\n}\n```\n\nSee the [Simple Analytics Docs](https://docs.simpleanalytics.com) for more details about the configuration options.\n\n```js\nmodule.exports = function (environment) {\n  var ENV = {\n    metricsAdapters: [\n      {\n        name: 'SimpleAnalytics',\n        environments: ['production'],\n        config: {\n          autoCollect: 'true',\n          allowParams: 'product-id',\n          collectDnt: false,\n          hostname: 'picturewham.com',\n          ignoreMetrices: ['scrolled', 'timeonpage'],\n          ignorePages: ['/search/contact', '/vouchers/*'],\n          mode: 'hash',\n          nonUniqueHostnames: 'checkout.stripe.com',\n          pathOverwriter: 'myPathOverwriter',\n          src: 'https://my-custom-script.example.org/latest.js',\n        }\n      }\n    ]\n  }\n}\n```\n\n\nUsage\n------------------------------------------------------------------------------\n\nThis adapter by default sets Simple Analytics auto collect to false. You must explicitly call `trackPage` when you transition into a route and you need to register `SimpleAnalytics` as a `metrics-adapter`, for example:\n\n```js\n// app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { getOwner } from '@ember/application';\nimport { service } from '@ember/service';\nimport SimpleAnalytics from 'ember-metrics-simple-analytics';\n\nexport default class ApplicationRoute extends Route {\n  @service metrics;\n  @service router;\n\n  constructor() {\n    super(...arguments);\n\n    getOwner(this).register(\n      'metrics-adapter:simple-analytics',\n      SimpleAnalytics\n    );\n\n    this.router.on('routeDidChange', () =\u003e {\n      const page = this.router.currentURL;\n      const title = this.router.currentRouteName || 'unknown';\n\n      this.metrics.trackPage({ page, title });\n    });\n  }\n}\n```\n\nTo send custom events use:\n\n```js\nthis.metrics.trackEvent({ name: 'myCustomeEvent', someotherkey: 'brilliant' });\n```\n\n### Deviations from plain Simple Analytics\n\n#### Auto Collect\n\nIf you've used Simple Analytics before without `ember-metrics` then you'll notice that auto page view collection is usually enabled for Simple Analytics without this adapter.\n\nDisabling Simple Analytics [auto collect page views](https://docs.simpleanalytics.com/trigger-custom-page-views) in this adapter allows for better integration with `ember-metrics`; it works well with multiple other adapters and is the expected behaviour of ember-metric adapters.\n\n#### Metadata or Context\n\nSimple Analytics provides numerous mechanisms to [collect additional data for events and page views](https://docs.simpleanalytics.com/metadata). The `ember-metrics` [`context`](https://github.com/adopted-ember-addons/ember-metrics#context) should be used instead of the Simple Analytics specific metadata mechanisms.\n\n**Warning**\nDo not include personal data in your metadata like email addresses, identifiers, or any other type of personal data. [Simple Analytics don’t allow it and your account might be suspended.](https://docs.simpleanalytics.com/metadata)\n\n```js\nthis.metrics.context = {\n  plan: 'starter'\n};\n```\n\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrloop%2Fember-metrics-simple-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrloop%2Fember-metrics-simple-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrloop%2Fember-metrics-simple-analytics/lists"}