angulartics2 12.0.0 → 12.2.0

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.0.0",
5
+ "version": "12.2.0",
6
6
  "release": {
7
7
  "branch": "master"
8
8
  },
@@ -29,7 +29,8 @@
29
29
  "kissmetrics",
30
30
  "segment",
31
31
  "amplitude",
32
- "baidu"
32
+ "baidu",
33
+ "pyze"
33
34
  ],
34
35
  "peerDependencies": {
35
36
  "@angular/common": ">=13.0.0-0",
@@ -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
+ ```
@@ -6,8 +6,8 @@ export declare class Angulartics2Pyze {
6
6
  startTracking(): void;
7
7
  pageTrack(path: string): void;
8
8
  eventTrack(action: string, properties: any): void;
9
- setUserId(userId: string): void;
10
- postTraits(properties: string): void;
9
+ setUserProfile(userId: string): void;
10
+ updateUserProfile(properties: any): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<Angulartics2Pyze, never>;
12
12
  static ɵprov: i0.ɵɵInjectableDeclaration<Angulartics2Pyze>;
13
13
  }