ABConvert Knowledge Base
  • Welcome to ABConvert
  • Getting started
    • ABConvert - Getting Started
    • ABConvert - How the Script Works
    • Use Cases
      • 💰Price Test Use Cases
      • 📦Shipping Test Use Cases
      • 🧩Template Test Use Cases
      • 🎨Theme Test Use Cases
      • 💳Checkout Test Use Case
      • 🔗URL Redirect Test Use Cases
      • ⚙️Advanced Options Use Cases
    • Best Practices
      • 🚦Test Design
  • Case Studies
    • How Smartwatchmagazijn Drove €10,000+ Monthly Growth Through A/B Testing
  • Price tests
    • Price Tests - Getting Started
    • Price Tests - How To Set Up
  • Shipping tests
    • Shipping Tests - Getting Started
    • Shipping Tests - How to Set Up
    • Shipping Test Event Listeners
    • Shipping Tests - Shipping Rates Mechanism
  • URL Redirect tests
    • URL Redirect Tests - Getting Started
    • URL Redirect Tests - How to Set Up
    • URL Redirect Tests - Trigger Conditions
  • URL Redirect Tests - QA Checklist
  • Template tests
    • Template Tests - Getting Started
    • Template Tests - How to Set Up
  • Theme tests
    • Theme Tests - Getting Started
    • Theme Tests - How to Set Up
  • Theme Tests - QA Checklist
  • Checkout tests
    • Checkout Tests - Getting Started
    • Checkout Tests - How to Set Up
  • Third Party App Integration
    • Third Party Integration List - Duplicate Variant Price Tests
    • Third Party Integration List - Cart Transform Price Tests
    • Page Builder Apps - Template Tests
  • Analytics
    • ABConvert Analytics Definition
    • Analytics Discrepancies
    • Statistical Significance Interpretation
  • More Resources
    • Changelog
    • FAQs
    • Submit User Feedback
Powered by GitBook
On this page
  1. Shipping tests

Shipping Test Event Listeners

ABConvert provides event listeners that developers can use to update custom logic for shipping tests.

ABConvert's shipping test is powerful for determining free shipping thresholds and shipping rates.

To make our shipping test more seamless when handling values in the shipping banner and shipping progress bar for some custom-built themes, we provide event listeners that developers can use to update their custom logic.

Initialized

The initialized event is the event that is triggered when our shipping script finish loading.

 document.addEventListener('abconvert:shipping:initialized', (event) => {
  const shippingTestData = event.detail.shippingTestData;
  console.log('abconvert:shipping:initialized: shippingTestData', shippingTestData);
});
type ShippingTestData = {
  rate: number; //shipping rate for the variant
  seed: string;
  thresholdValue: number; //shipping threshold value
  type: string; // the shipping test type "FREE_SHIPPING_THRESHOLD","FLAT_RATE_SHIPPING","ADVANCED_SHIPPING"
  variant: string; // the variant group of this visitor
  advancedRates?: AdvanceRate[];
};

//all the rate and thresholdValue  here is presented as subunits. 
// If the currency doesn't use subunits, then the value must be multiplied by 100. 
// For example: `"rate": 500` for 5.00 CAD, `"thresholdValue": 100000` for 1000 JPY.

type AdvanceRate  = {
  conditionType: string; // "weight", "price"
  hasCondition: boolean; 
  maximum: number;//condition max value presented as subunits.  
  minimum: number;//condition max value presented as subunits. 
  price: number; //shipping rate presented as subunits. 
  weightUnit: string; // "kg", "lb", "oz"
};

The event will only be triggered in the following scenarios:

  1. Shipping Zone Match: The country must be included in the shipping zone. If you're testing from a country outside your selected shipping zone, ensure you're using a VPN to simulate being in one of the countries within the shipping zone.

  2. Preview Mode: You can manually trigger the event by using preview mode. To do this, append the following query parameters to your URL: ?preview=<group_index>&country=<country_code>.

Finally, make sure to enable the abconvert-shipping-script in the app embed settings.

PreviousShipping Tests - How to Set UpNextShipping Tests - Shipping Rates Mechanism

Last updated 3 months ago

For any feedback, feel free to reach out to .

support@abconvert.io