Conversion Code
For better analytics, you need to implement JOIN Script to your website.
Initialization
Advanced Analytics for e-commercant
For e-commercant, it is highly recommended to implement those callback for better analytics.
sendProductAddToCart
sendProductAddToCart
Description:
You should emit this event when a product is added to the cart.
Parameters:
payload : Details of the product added to the cart.
Payload Structure:
- product_id (string, required): Unique identifier of the product.
- product_name (string, optional): Name of the product.
- product_variant (string, optional): Variant of the product (e.g., color, size).
- product_price (number, required): Selling price of the product.
- product_base_price (number, required): Base price before discounts.
- product_final_price (number, required): Final price after discounts.
- product_quantity (number, required): Quantity added to the cart.
- currency (string, required): Currency code (e.g., 'USD', 'EUR').
Usage Example:
window.JoinStories.sendProductAddToCart({
product_id: 'P12345',
product_name: 'Chapeau',
product_variant: 'Red',
product_price: 29.99,
product_base_price: 39.99,
product_final_price: 29.99,
product_quantity: 2,
currency: 'USD',
});
sendProductRemoveFromCart
sendProductRemoveFromCart
Description:
You should emit this event when a product is removed from the cart.
Parameters:
payload : Details of the product removed from the cart.
Payload Structure:
- product_id (string, required): Unique identifier of the product.
- product_name (string, optional): Name of the product.
- product_variant (string, optional): Variant of the product (e.g., color, size).
- product_price (number, required): Selling price of the product.
- product_base_price (number, required): Base price before discounts.
- product_final_price (number, required): Final price after discounts.
- product_quantity (number, required): Quantity added to the cart.
- currency (string, required): Currency code (e.g., 'USD', 'EUR').
Usage Example:
window.JoinStories.sendProductRemoveFromCart({
product_id: 'P12345',
product_name: 'Chapeau',
product_variant: 'Red',
product_price: 29.99,
product_base_price: 39.99,
product_final_price: 29.99,
product_quantity: 1,
currency: 'USD',
});
sendProductAddToFavorite
sendProductAddToFavorite
Description:
You should emit this event when a product is added to the favorites list.
Parameters:
payload : Details of the product added to favorites.
Payload Structure:
- product_id (string, required): Unique identifier of the product.
- product_variant (string, optional): Variant of the product.
- product_price (number, required): Selling price of the product.
- product_base_price (number, required): Base price before discounts.
- product_final_price (number, required): Final price after discounts.
- currency (string, required): Currency code.
Usage Example:
window.JoinStories.sendProductAddToFavorite({
product_id: 'P67890',
product_variant: 'Blue',
product_price: 49.99,
product_base_price: 59.99,
product_final_price: 49.99,
currency: 'USD',
});
sendCartValidated
sendCartValidated
Description:
You should emit this event when the cart is validated, typically after a successful checkout.
Parameters:
payload : Transaction details and list of products purchased.
Payload Structure:
Field | Type | Required | Description |
---|---|---|---|
total_base_amount | number | ✅ | Total amount before discounts |
total_final_amount | number | ✅ | Total amount after discounts |
currency | string | ✅ | Currency code (e.g., 'EUR', 'USD') |
products | array | ✅ | List of products |
products[].product_id | string | ✅ | Unique product ID |
products[].product_name | string | ⚪ | Product name |
products[].product_variant | string | ⚪ | Product variant |
products[].product_price | number | ✅ | Selling price |
products[].product_base_price | number | ✅ | Base price before discount |
products[].product_final_price | number | ✅ | Final price after discount |
products[].product_quantity | number | ✅ | Quantity purchased |
products[].currency | string | ✅ | Product currency code |
Usage Example:
window.JoinStories.sendCartValidated({
transaction_id: 'TXN1001',
total_base_amount: 89.98,
total_final_amount: 69.98,
currency: 'USD',
products: [
{
product_id: 'P12345',
product_name: 'Chapeau',
product_variant: 'Red',
product_price: 29.99,
product_base_price: 39.99,
product_final_price: 29.99,
product_quantity: 1,
currency: 'USD',
},
{
product_id: 'P67890',
product_variant: 'Blue',
product_price: 39.99,
product_base_price: 49.99,
product_final_price: 39.99,
product_quantity: 1,
currency: 'USD',
},
],
});
Custom conversion
Description
If you want to track JOIN impact on a custom type of conversion, you may use this documentation.
Updated 16 days ago