@session-services/web-elements 0.1.13 → 0.1.16

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.
@@ -92,6 +92,11 @@ export class SessionsTicketing {
92
92
  ...properties,
93
93
  });
94
94
  }
95
+ getLowestPrice() {
96
+ if (!this.event?.admissions.length)
97
+ return 0;
98
+ return Math.min(...this.event.admissions.map((adm) => (adm.price?.base || 0) + (adm.price?.booking || 0)));
99
+ }
95
100
  async loadEventData() {
96
101
  try {
97
102
  this.loading = true;
@@ -103,8 +108,26 @@ export class SessionsTicketing {
103
108
  client: this.client,
104
109
  debug: this.debugAnalytics,
105
110
  });
111
+ this.analytics.page("Ticketing Widget", {
112
+ event_id: this.eventId,
113
+ team_id: this.event.teamId,
114
+ promoter_id: this.event.promoterId,
115
+ event_name: this.event.name,
116
+ event_slug: this.event.slug,
117
+ });
106
118
  }
107
119
  if (this.event) {
120
+ this.trackEvent("Product Viewed", {
121
+ product_id: this.eventId,
122
+ sku: this.eventId,
123
+ name: this.event.name,
124
+ category: "Event",
125
+ value: this.getLowestPrice() / 100,
126
+ price: this.getLowestPrice() / 100,
127
+ event_date: this.event.entryStartsAt,
128
+ venue_name: this.event.location?.venue?.name || this.event.location?.name,
129
+ venue_city: this.event.location?.city,
130
+ });
108
131
  this.trackEvent("Product List Viewed", {
109
132
  list_id: this.eventId,
110
133
  category: "Admissions",