angulartics2 12.1.0 → 12.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "../../node_modules/ng-packagr/package.schema.json",
3
3
  "name": "angulartics2",
4
4
  "description": "Vendor-agnostic web analytics for Angular2 applications",
5
- "version": "12.1.0",
5
+ "version": "12.2.1",
6
6
  "release": {
7
7
  "branch": "master"
8
8
  },
@@ -0,0 +1,100 @@
1
+ <img
2
+ src="../../../assets/svg/incendium.svg"
3
+ alt="Incendium analytics logo"
4
+ height="100px"
5
+ width="200px" />
6
+
7
+ **homepage**: [incendium.ai](https://www.incendium.ai/)
8
+ **import**: `import { Angulartics2Incendium } from 'angulartics2';`
9
+
10
+ ## Setup
11
+
12
+ 1. Add tracking code provided by Incendium inside the header tag.
13
+
14
+ 2. [Setup Angulartics](https://github.com/angulartics/angulartics2/tree/master#installation) using `Angulartics2Incendium`
15
+
16
+ ```typescript
17
+ constructor(Angulartics2Incendium: Angulartics2Incendium) {
18
+ Angulartics2Incendium.startTracking();
19
+ }
20
+ ```
21
+
22
+ 3. Track Conversions, You can track conversions using Angulartics2 event tracking.
23
+ this can be done by adding the following to you html
24
+
25
+ ```html
26
+ <button
27
+ angulartics2On="click"
28
+ angularticsAction="{{ eIncendiumEventNames.ADD_CONVERION }}"
29
+ [angularticsProperties]="{ key: 'my_trigger_as_assigned_in_incendium' }"
30
+ >
31
+ Btn click
32
+ </button>
33
+ ```
34
+
35
+ Note that eIncendiumEventNames is a reference to IncendiumEventNames expoted from Angulartics2Incendium
36
+
37
+ Or you can fire the conversion in code for example
38
+
39
+ ```typescript
40
+ this.angulartics2.eventTrack.next({
41
+ action: IncendiumEventNames.ADD_CONVERION,
42
+ properties: {
43
+ key: 'my_trigger_as_assigned_in_incendium',
44
+ },
45
+ });
46
+ ```
47
+
48
+ 4. Incendium allows for offline tracking, to do this you must record the conversion key provided when firing a conversion.
49
+ A example of this would be a contact form which you later convert on the phone, incendium allows you to assign revenue next to this original conversion using this key
50
+
51
+ to do this fire a conversion off as above.
52
+ you can then subscribe to incendiumResponse. once the conversion has been tracked and response is returned you can use this response how ever you like.
53
+
54
+ **_Dont forget to unsubscribe_**
55
+
56
+ An Example workflow of this would be
57
+
58
+ ```typescript
59
+ export class Example implements OnInit {
60
+ private incSubscription;
61
+
62
+ constructor(
63
+ private angulartics2: Angulartics2,
64
+ private angulartics2Incendium: Angulartics2Incendium,
65
+ ) {}
66
+
67
+ ngOnInit(): void {
68
+ this.incSubscription = this.angulartics2Incendium.incendiumResponse.subscribe({
69
+ next: v => {
70
+ if (v.type === IncendiumEventNames.ADD_CONVERION) {
71
+ this.submit(v.value);
72
+ }
73
+ },
74
+ error: e => {
75
+ console.error(e);
76
+ // submit without key or handle how you like
77
+ this.submit();
78
+ },
79
+ });
80
+ }
81
+
82
+ ngOnDestroy(): void {
83
+ // Dont forget to unsubscribe
84
+ this.incSubscription.unsubscribe();
85
+ }
86
+
87
+ onSubmit() {
88
+ this.angulartics2.eventTrack.next({
89
+ action: IncendiumEventNames.ADD_CONVERION,
90
+ properties: {
91
+ key: 'my_trigger_as_assigned_in_incendium',
92
+ },
93
+ });
94
+ }
95
+
96
+ submit(incendiumKey?: string) {
97
+ alert(`form submitted with ${incendiumKey ? `key ${incendiumKey}` : `no key`}`);
98
+ }
99
+ }
100
+ ```
@@ -3,7 +3,6 @@ import * as i0 from "@angular/core";
3
3
  export declare type EventTrackAction = 'setEcommerceView' | 'addEcommerceItem' | 'trackEcommerceCartUpdate' | 'trackEcommerceOrder' | 'trackLink' | 'trackGoal' | 'trackSiteSearch' | string;
4
4
  export declare type ScopeMatomo = 'visit' | 'page';
5
5
  export interface DimensionsMatomoProperties {
6
- dimension0?: string;
7
6
  dimension1?: string;
8
7
  dimension2?: string;
9
8
  dimension3?: string;
@@ -13,6 +12,12 @@ export interface DimensionsMatomoProperties {
13
12
  dimension7?: string;
14
13
  dimension8?: string;
15
14
  dimension9?: string;
15
+ dimension10?: string;
16
+ dimension11?: string;
17
+ dimension12?: string;
18
+ dimension13?: string;
19
+ dimension14?: string;
20
+ dimension15?: string;
16
21
  }
17
22
  export interface SetEcommerceViewMatomoProperties {
18
23
  /** @class SetEcommerceViewMatomoProperties */
@@ -82,9 +87,9 @@ export interface TrackEventMatomoProperties {
82
87
  /** @class TrackEventMatomoProperties */
83
88
  label?: string;
84
89
  /** @class TrackEventMatomoProperties */
85
- value: number | string;
90
+ value?: number | string;
86
91
  }
87
- export interface SetCustomVariableMatomoProperties extends DimensionsMatomoProperties {
92
+ export interface SetCustomVariableMatomoProperties {
88
93
  /** @class SetCustomVariableMatomoProperties */
89
94
  index: number;
90
95
  /** @class SetCustomVariableMatomoProperties */
@@ -126,7 +131,7 @@ export declare class Angulartics2Matomo {
126
131
  * If in doubt, prefer custom dimensions.
127
132
  * @link https://matomo.org/docs/custom-variables/
128
133
  */
129
- setUserProperties(properties: SetCustomVariableMatomoProperties): void;
134
+ setUserProperties(properties: SetCustomVariableMatomoProperties | DimensionsMatomoProperties): void;
130
135
  /**
131
136
  * If you created a custom variable and then decide to remove this variable from
132
137
  * a visit or page view, you can use deleteCustomVariable.
@@ -7,7 +7,7 @@ export declare class Angulartics2Pyze {
7
7
  pageTrack(path: string): void;
8
8
  eventTrack(action: string, properties: any): void;
9
9
  setUserProfile(userId: string): void;
10
- updateUserProfile(properties: string): void;
10
+ updateUserProfile(properties: any): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<Angulartics2Pyze, never>;
12
12
  static ɵprov: i0.ɵɵInjectableDeclaration<Angulartics2Pyze>;
13
13
  }