ember-metrics
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -37,3 +37,3 @@ import Ember from 'ember'; | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | ||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | ||
/* jshint ignore:end */ | ||
@@ -61,2 +61,7 @@ | ||
if (compactedOptions.nonInteraction) { | ||
gaEvent.nonInteraction = compactedOptions.nonInteraction; | ||
delete compactedOptions.nonInteraction; | ||
} | ||
for (let key in compactedOptions) { | ||
@@ -63,0 +68,0 @@ const capitalizedKey = capitalize(key); |
{ | ||
"name": "ember-metrics", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Send data to multiple analytics integrations without re-implementing new API", | ||
@@ -5,0 +5,0 @@ "directories": { |
# ember-metrics | ||
*Send data to multiple analytics services without re-implementing new API* | ||
[![npm version](https://badge.fury.io/js/ember-metrics.svg)](http://badge.fury.io/js/ember-metrics) [![Build Status](https://travis-ci.org/poteto/ember-metrics.svg)](https://travis-ci.org/poteto/ember-metrics) [![Ember Observer Score](http://emberobserver.com/badges/ember-metrics.svg)](http://emberobserver.com/addons/ember-metrics) | ||
[![npm version](https://badge.fury.io/js/ember-metrics.svg)](http://badge.fury.io/js/ember-metrics) [![Build Status](https://travis-ci.org/poteto/ember-metrics.svg?branch=master)](https://travis-ci.org/poteto/ember-metrics) [![Ember Observer Score](http://emberobserver.com/badges/ember-metrics.svg)](http://emberobserver.com/addons/ember-metrics) | ||
@@ -16,5 +16,5 @@ This addon adds a simple `metrics` service to your app that makes it simple to send data to multiple analytics services without having to implement a new API each time. | ||
- `id`: [Property ID](https://support.google.com/analytics/answer/1032385?hl=en), e.g. `UA-XXXX-Y` | ||
2. `Mixpanel` | ||
1. `Mixpanel` | ||
- `token`: [Mixpanel token](https://mixpanel.com/help/questions/articles/where-can-i-find-my-project-token) | ||
3. `GoogleTagManager` | ||
1. `GoogleTagManager` | ||
- `id`: [Container ID](https://developers.google.com/tag-manager/quickstart), e.g. `GTM-XXXX` | ||
@@ -29,4 +29,6 @@ | ||
``` | ||
4. `KISSMetrics` (WIP) | ||
5. `CrazyEgg` (WIP) | ||
1. `Segment` | ||
- `key`: [Segment key](https://segment.com/docs/libraries/analytics.js/quickstart/) | ||
1. `KISSMetrics` (WIP) | ||
1. `CrazyEgg` (WIP) | ||
@@ -48,3 +50,3 @@ ## Installing The Addon | ||
## Compatibility | ||
This addon is tested against the `release`, `beta`, and `canary` channels, as well as `~1.11.0`, and `1.12.1`. | ||
This addon is tested against the `release`, `beta`, and `canary` channels, as well as `~1.11.0`, and `1.12.1`. | ||
@@ -74,2 +76,9 @@ ## Configuration | ||
{ | ||
name: 'Segment', | ||
environments: ['production'] | ||
config: { | ||
key: '4fce-8a0f-a9a8f89d1453' | ||
} | ||
}, | ||
{ | ||
name: 'LocalAdapter', | ||
@@ -123,2 +132,19 @@ environments: ['all'] // default | ||
## Content Security Policy | ||
If you're using [ember-cli-content-security-policy](https://github.com/rwjblue/ember-cli-content-security-policy), you'll need to modify the content security policy to allow loading of any remote scripts. In `config/environment.js`, add this to the `ENV` hash (modify as necessary): | ||
```js | ||
// example for loading Google Analytics | ||
contentSecurityPolicy: { | ||
'default-src': "'none'", | ||
'script-src': "'self' www.google-analytics.com", | ||
'font-src': "'self'", | ||
'connect-src': "'self' www.google-analytics.com", | ||
'img-src': "'self'", | ||
'style-src': "'self'", | ||
'media-src': "'self'" | ||
} | ||
``` | ||
## Usage | ||
@@ -146,3 +172,3 @@ | ||
const title = this.getWithDefault('currentRouteName', 'unknown'); | ||
Ember.get(this, 'metrics').trackPage({ page, title }); | ||
@@ -149,0 +175,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33790
29
641
325