This is how you can send a order creation (subscription, conversion, etc) event to the Fera server to be added to the current shopper's journey.
If you're already using one of our Shopify, BigCommerce, Magento or other apps then you don't need to send an order/conversion event - it's sent automatically.
This example assumes that we already have synced product, variant and customer data in the setProduct
and setCustomer
actions when accessed in previous pages.
fera.push('order', { // FYI fera.push('pushOrder' also works, this is just more readableid: "12345",line_items: [{name: "Product 123",product_id: "product-123",variant_id: "variation1", // If variant existstotal: 100.0}],customer_id: "customer-123"});
fera.push('order', {id: "12345", // Required - Integer, String: A unique identifier that your platform can identify the order by.number: "order-5", // Optional - Integer, String: A user-friendly order identifier that appears on the order frontend.test: false, // Optional - Boolean: If true, the order will be skipped in certain calculations.canceled: false, // Optional - Boolean If true, the order will be ignored from certain calculations.total: 10.0, // Optional - Float: If not provided, then line item totals must be provided.total_usd: 10.0, // Optional - Float: If not USD main currencycreated_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)modified_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)source_name: "web", // (Optional) Stringline_items: [{ // Required - Array<LineItem>name: "Subscription to Product 123", // Required - Stringid: "line-1", // Optional - Stringquantity: 1, // Optional - Integer: Assumes 1 if not providedtotal: 10.0, // Required - Floattotal_usd: 10.0, // Optional - Float: If not USD main currencyvariant_id: "variation1", // (Optional) String: If a variation was particularly selected, then specify it hereproduct_id: "123", // Optional - String: Either this field or the "product" field most be specified.product: { // Optional - Product: Either this field or the "product_id" field most be specified.id: "product-123", // Stringname: "Product 123", // Stringstatus: "published", // (Optional) Stringprice: 99.89, // (Optional) Floatcreated_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)modified_at: "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)stock: 123, // (Optional) Integer, If null assumed to be infinite.in_stock: true, // (Optional) Booleanurl: "https://www.example.com/products/product-123", // Stringthumbnail_url: "https://cdn.example.com/products/product-123/image.png", // Stringneeds_shipping: true, // (Optional) Booleanhidden: false, // (Optional) Booleanvariants: [{ // (Optional) Array<Variant>: Variants that are applicable to this product.id: "product-123-variation1", // Stringname: "Product 123 - Variation 1",stock: 10, // (Optional) Integer, String: Only used if stock is not specified by parent product schema.in_stock: true, // (Optional) String, Booleanthumbnail_url: "https://cdn.example.com/products/product-123/variation1/image.png", // (Optional) String}],platform_data: { custom_attribute: "custom value" } // (Optional) Hash/Object of attributes to store about the product specific to the integration platform (can be used in future filters)}}],shopper: {customer_id: "customer-123",name: "John Doe",email: "john.doe@example.com",country_code: "US",region_name: "California",city_name: "Orange County",zip: "78730",platform_data: { custom_attribute: "custom value" }}});​
​Cart​