@@ -12,6 +12,8 @@ export class CustomEvent {
12
12
_value ?: number ;
13
13
_properties : JsonObject ;
14
14
_transactionId ?: string ;
15
+ _interactionId ?: string ;
16
+ _interactionType ?: string ;
15
17
16
18
/**
17
19
* Custom event constructor.
@@ -39,6 +41,34 @@ export class CustomEvent {
39
41
this . _transactionId = value ;
40
42
}
41
43
44
+ /**
45
+ * Gets the event's interaction ID.
46
+ */
47
+ get interactionId ( ) : string | undefined {
48
+ return this . _interactionId ;
49
+ }
50
+
51
+ /**
52
+ * Sets the event's interaction ID.
53
+ */
54
+ set interactionId ( value : string | undefined ) {
55
+ this . _interactionId = value ;
56
+ }
57
+
58
+ /**
59
+ * Gets the event's interaction Type.
60
+ */
61
+ get interactionType ( ) : string | undefined {
62
+ return this . _interactionType ;
63
+ }
64
+
65
+ /**
66
+ * Sets the event's interaction Type.
67
+ */
68
+ set interactionType ( value : string | undefined ) {
69
+ this . _interactionType = value ;
70
+ }
71
+
42
72
/**
43
73
* Adds a property to the custom event.
44
74
*
@@ -56,13 +86,19 @@ export class CustomEvent {
56
86
*/
57
87
toJsonValue ( ) : JsonValue {
58
88
let jsonObject : JsonObject = { } ;
59
- jsonObject . event_name = this . _name ;
89
+ jsonObject . eventName = this . _name ;
60
90
if ( this . _value ) {
61
- jsonObject . event_value = this . _value ;
91
+ jsonObject . eventValue = this . _value ;
62
92
}
63
93
jsonObject . properties = this . _properties ;
64
94
if ( this . _transactionId ) {
65
- jsonObject . transaction_id = this . _transactionId ;
95
+ jsonObject . transactionId = this . _transactionId ;
96
+ }
97
+ if ( this . _interactionId ) {
98
+ jsonObject . interactionId = this . _interactionId ;
99
+ }
100
+ if ( this . _interactionType ) {
101
+ jsonObject . interactionType = this . _interactionType ;
66
102
}
67
103
return jsonObject ;
68
104
}
0 commit comments