@schibsted/niche-tracking
Advanced tools
Comparing version 4.11.1 to 4.11.2
import Tracker from './tracker'; | ||
import pulse from './pulse'; | ||
import googleAnalytics from './googleAnalytics'; | ||
import mbl from './mbl'; | ||
export * from './types'; | ||
export { Tracker, googleAnalytics, mbl, pulse }; | ||
export { Tracker, mbl, pulse }; |
import Tracker from './tracker'; | ||
import pulse from './pulse'; | ||
import googleAnalytics from './googleAnalytics'; | ||
import mbl from './mbl'; | ||
export * from './types'; | ||
export { Tracker, googleAnalytics, mbl, pulse }; | ||
export { Tracker, mbl, pulse }; |
@@ -1,6 +0,5 @@ | ||
export type TrackerTypes = 'googleAnalytics' | 'mbl' | 'pulse'; | ||
export type TrackerTypes = 'mbl' | 'pulse'; | ||
export type MapperFunction<T> = (payload?: T) => any; | ||
export type EventMapperFunction<T> = (payload: T, lastPageViewEventData: any) => any; | ||
export type Mapper<T> = { | ||
googleAnalytics?: MapperFunction<T>; | ||
mbl?: MapperFunction<T>; | ||
@@ -10,3 +9,2 @@ pulse?: MapperFunction<T>; | ||
export type EventMapper<T> = { | ||
googleAnalytics?: EventMapperFunction<T>; | ||
mbl?: EventMapperFunction<T>; | ||
@@ -35,10 +33,2 @@ pulse?: EventMapperFunction<T>; | ||
}; | ||
export type GoogleAnalyticsConfig = { | ||
cdn?: string; | ||
enabled?: boolean; | ||
id?: string; | ||
options?: { | ||
anonymize_ip?: boolean; | ||
}; | ||
}; | ||
export type Experiment = { | ||
@@ -69,5 +59,4 @@ id: string; | ||
export type TrackersConfig = { | ||
googleAnalytics?: GoogleAnalyticsConfig; | ||
mbl?: MBLConfig; | ||
pulse?: PulseConfig; | ||
}; |
{ | ||
"name": "@schibsted/niche-tracking", | ||
"version": "4.11.1", | ||
"version": "4.11.2", | ||
"repository": { | ||
@@ -31,3 +31,3 @@ "type": "git", | ||
}, | ||
"gitHead": "8b11066ca08cead7ca60ecdc613e0ca27ddee6c2" | ||
"gitHead": "ba5efa2522980f078b33d256c7a84fc06d34ab4f" | ||
} |
@@ -58,3 +58,3 @@ # Niche Tracking | ||
Currently pulse, google analytics and mbl trackers are implemented. | ||
Currently pulse and mbl trackers are implemented. | ||
@@ -66,3 +66,3 @@ ## How to use it and how it works | ||
```javascript | ||
import { Tracker, pulse, googleAnalytics, mbl } from '@schibsted/niche-tracking'; | ||
import { Tracker, pulse, mbl } from '@schibsted/niche-tracking'; | ||
``` | ||
@@ -78,3 +78,3 @@ | ||
enabled, | ||
trackers: [pulse, googleAnalytics, mbl], | ||
trackers: [pulse, mbl], | ||
}); | ||
@@ -89,3 +89,2 @@ ``` | ||
- [pulse](./src/pulse/README.md) | ||
- [google analytics](./src/googleAnalytics/README.md) | ||
- [mbl](./src/mbl/README.md) | ||
@@ -141,5 +140,2 @@ | ||
}), | ||
googleAnalytics: (options) => ({ | ||
page_path: options.location.pathname, | ||
}), | ||
mbl: (options) => ({ | ||
@@ -163,3 +159,3 @@ url: window.location.toString(), | ||
enabled, | ||
trackers: [pulse, googleAnalytics, mbl], | ||
trackers: [pulse, mbl], | ||
}); | ||
@@ -171,3 +167,2 @@ ``` | ||
- pulseSpecificOptions, | ||
- googleAnalyticsSpecificOptions | ||
- mblSpecificOptions | ||
@@ -177,3 +172,3 @@ | ||
Next it will call `pulse.pagewiew(pulseSpecificOptions)`, `googleAnalytics.pageView(googleAnalyticsSpecificOptions)`, `mbl.pagewiew(mblSpecificOptions)`. | ||
Next it will call `pulse.pagewiew(pulseSpecificOptions)`, `mbl.pagewiew(mblSpecificOptions)`. | ||
@@ -180,0 +175,0 @@ As you can see it enables you to implement most of the tracking in declarative way. All you need is choose which trackers you need and provide proper options mapping. |
import Tracker from './tracker'; | ||
import pulse from './pulse'; | ||
import googleAnalytics from './googleAnalytics'; | ||
import mbl from './mbl'; | ||
@@ -8,2 +7,2 @@ | ||
export { Tracker, googleAnalytics, mbl, pulse }; | ||
export { Tracker, mbl, pulse }; |
@@ -1,2 +0,2 @@ | ||
export type TrackerTypes = 'googleAnalytics' | 'mbl' | 'pulse'; | ||
export type TrackerTypes = 'mbl' | 'pulse'; | ||
@@ -7,3 +7,2 @@ export type MapperFunction<T> = (payload?: T) => any; | ||
export type Mapper<T> = { | ||
googleAnalytics?: MapperFunction<T>; | ||
mbl?: MapperFunction<T>; | ||
@@ -14,3 +13,2 @@ pulse?: MapperFunction<T>; | ||
export type EventMapper<T> = { | ||
googleAnalytics?: EventMapperFunction<T>; | ||
mbl?: EventMapperFunction<T>; | ||
@@ -43,11 +41,2 @@ pulse?: EventMapperFunction<T>; | ||
export type GoogleAnalyticsConfig = { | ||
cdn?: string; | ||
enabled?: boolean; | ||
id?: string; | ||
options?: { | ||
anonymize_ip?: boolean; | ||
}; | ||
}; | ||
export type Experiment = { | ||
@@ -80,5 +69,4 @@ id: string; | ||
export type TrackersConfig = { | ||
googleAnalytics?: GoogleAnalyticsConfig; | ||
mbl?: MBLConfig; | ||
pulse?: PulseConfig; | ||
}; |
64290
28
1302
247