Skip to content

Commit 2525cd3

Browse files
committed
Update models
Moved Pixel event names from inline to models as new type PixelEventName
1 parent a268784 commit 2525cd3

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

projects/pixel/src/lib/pixel.models.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,22 @@ export interface PixelEventProperties {
7979
'VEF' | 'VND' |
8080
'ZAR';
8181
}
82+
83+
export type PixelEventName = 'AddPaymentInfo' |
84+
'AddToCart' |
85+
'AddToWishlist' |
86+
'CompleteRegistration' |
87+
'Contact' |
88+
'CustomizeProduct' |
89+
'Donate' |
90+
'FindLocation' |
91+
'InitiateCheckout' |
92+
'Lead' |
93+
'PageView' |
94+
'Purchase' |
95+
'Schedule' |
96+
'Search' |
97+
'StartTrial' |
98+
'SubmitApplication' |
99+
'Subscribe' |
100+
'ViewContent';

projects/pixel/src/lib/pixel.service.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PixelConfiguration, PixelEventProperties } from './pixel.models';
1+
import { PixelEventName, PixelConfiguration, PixelEventProperties } from './pixel.models';
22
import { Inject, Injectable, Optional } from '@angular/core';
33
import { NavigationEnd, Router } from '@angular/router';
44
import { filter } from 'rxjs/operators';
@@ -51,25 +51,7 @@ export class PixelService {
5151
* @param properties Optional properties of the event
5252
*/
5353
track(
54-
eventName:
55-
'AddPaymentInfo' |
56-
'AddToCart' |
57-
'AddToWishlist' |
58-
'CompleteRegistration' |
59-
'Contact' |
60-
'CustomizeProduct' |
61-
'Donate' |
62-
'FindLocation' |
63-
'InitiateCheckout' |
64-
'Lead' |
65-
'PageView' |
66-
'Purchase' |
67-
'Schedule' |
68-
'Search' |
69-
'StartTrial' |
70-
'SubmitApplication' |
71-
'Subscribe' |
72-
'ViewContent',
54+
eventName: PixelEventName,
7355
properties?: PixelEventProperties
7456
): void {
7557

0 commit comments

Comments
 (0)