@session-services/web-elements 0.1.26 → 0.1.28

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.
@@ -1059,10 +1059,6 @@ textarea {
1059
1059
  }
1060
1060
 
1061
1061
  @media (max-width: 767px) {
1062
- :host([data-sticky-checkout="true"]) .session-services-ticketing-container {
1063
- padding-bottom: calc(var(--internal-spacing-xl) * 3);
1064
- }
1065
-
1066
1062
  :host([data-sticky-checkout="true"]) .checkout-actions > .checkout-btn,
1067
1063
  :host([data-sticky-checkout="true"]) .inline-external-ticket-button {
1068
1064
  display: none;
@@ -825,7 +825,6 @@ export class SessionsTicketing {
825
825
  try {
826
826
  this.checkoutLoading = true;
827
827
  this.quoteError = null;
828
- this.trackCheckoutStarted(this.quote);
829
828
  const result = await this.client.order.create({
830
829
  eventId: this.eventId,
831
830
  items: this.getCheckoutItems(this.quote),
@@ -833,15 +832,17 @@ export class SessionsTicketing {
833
832
  returnUrl: this.returnUrl,
834
833
  channel: buildOrderChannel("elements"),
835
834
  });
835
+ this.trackCheckoutStarted(this.quote, result.order.id);
836
836
  this.handleCheckoutOrder(result.order);
837
837
  }
838
838
  catch (_err) {
839
839
  this.handleCheckoutError();
840
840
  }
841
841
  }
842
- trackCheckoutStarted(quote) {
842
+ trackCheckoutStarted(quote, orderId) {
843
843
  const total = quoteTotal(quote) / 100;
844
844
  this.trackEvent("Checkout Started", {
845
+ order_id: orderId,
845
846
  value: total,
846
847
  revenue: total,
847
848
  currency: this.event?.currency,
@@ -158,6 +158,7 @@ function widget() {
158
158
  item.error = null;
159
159
  item.activePasscode = "";
160
160
  item.cartUpdate = { emit: vi.fn() };
161
+ item.checkoutInit = { emit: vi.fn() };
161
162
  item.errorOccurred = { emit: vi.fn() };
162
163
  item.client = {
163
164
  event: {
@@ -376,6 +377,24 @@ describe("session-services-ticketing component", () => {
376
377
  cta_surface: "sticky",
377
378
  }));
378
379
  });
380
+ it("tracks hosted checkout starts with the created order id", async () => {
381
+ const item = widget();
382
+ const track = vi.fn();
383
+ item.analytics = { track };
384
+ item.quote = quote();
385
+ item.selectedItems = new Map([[selectionKey("adm_general", null), 1]]);
386
+ item.client.order.create = vi.fn().mockResolvedValue({
387
+ order: {
388
+ checkoutUrl: "https://checkout.example/ord_1",
389
+ id: "ord_1",
390
+ },
391
+ });
392
+ await item.initiateCheckout();
393
+ expect(track).toHaveBeenCalledWith("Checkout Started", expect.objectContaining({
394
+ order_id: "ord_1",
395
+ value: 22,
396
+ }));
397
+ });
379
398
  it("scrolls to the ticket selector with a 100px top offset", () => {
380
399
  const item = widget();
381
400
  const scrollTo = vi.fn();