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

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_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_variant: 'Red',  
  product_price: 29.99,  
  product_base_price: 39.99,  
  product_final_price: 29.99,  
  product_quantity: 2,  
  currency: 'USD',  
});

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_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_variant: 'Red',  
  product_price: 29.99,  
  product_base_price: 39.99,  
  product_final_price: 29.99,  
  product_quantity: 1,  
  currency: 'USD',  
});

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

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:

  • transaction_id (string, required): Unique identifier for the transaction.
  • total_base_amount (number, required): Total amount before discounts.
  • total_final_amount (number, required): Total amount after discounts.
  • currency (string, required): Currency code.
  • products (array of objects, required): List of products in the transaction. Each product object includes:
  • product_id (string, required)
  • product_variant (string, optional)
  • product_price (number, required)
  • product_base_price (number, required)
  • product_final_price (number, required)
  • product_quantity (number, required)
  • currency (string, required)

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_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',  
    },  
  ],  
});