ConvertedIn | DOCS
  • Overview
  • Before you start
    • Integrating Firebase Cloud Messaging for Push Notifications
  • Android
    • Getting started with Android SDK
  • IOS
    • Getting started with the iOS SDK
  • WooCommerce
    • Getting Started
    • Plugin installation steps
  • Shopify
    • Getting Started
  • API
    • Connect your store using API, Getting started
    • Categories
    • Products
    • Customers
    • Orders
    • Webhooks
  • magento | webhooks
    • Getting started
  • Salla
    • Getting started
  • Pixel
    • Getting Started
    • Client SDK
    • Integrate ConvertedIn Pixel using GTM
    • Shopify Integration for Initiate checkout Event
  • DSP
    • Getting Started
Powered by GitBook
On this page

Was this helpful?

  1. Pixel

Shopify Integration for Initiate checkout Event

Accourding to Shopify restriction on checkout page you can configure the `Initiate checkout` event on your shopify store.

PreviousIntegrate ConvertedIn Pixel using GTMNextGetting Started

Last updated 9 months ago

Was this helpful?

Follow these steps to add the Convertedin pixel checkout event

  • first go to Themes on the Online Store tab on the sidebar

  • then select the edit the theme.liquid file and the initialization code of the pixel

  • Add the InitiateCheckout Event on click at checkout button

  • You should add "your_pixel_id" with the pixel id in the setting tab in Convertedin dashboard

{% if request.page_type == 'cart' %}
  <script>
 let interval = setInterval(()=>{
            if(typeof ciq == "function"){
                 ciq("init", "your_pixel_id"); // the PixelId provided in convertedin dashboard
  var checkoutElm = document.getElementsByName('checkout')[0];
  if (checkoutElm) {
  checkoutElm.onclick = function(event) {
    var cart = {{ cart | json }};
  var originalCartItems = cart.items || {};
  var requestedCartItems = [];
  
  originalCartItems.forEach(function(item, index){
    var addedToCartObj = {id: null,quantity: 0, name:""};
    if(item.hasOwnProperty("id")) addedToCartObj.id = item.id;
    if(item.hasOwnProperty("quantity")) addedToCartObj.quantity = item.quantity;
    if(item.hasOwnProperty("title")) addedToCartObj.name = item.title;

    requestedCartItems.push(addedToCartObj);
  });
    
     ciq("track", "InitiateCheckout", {
        content: requestedCartItems, 
        currency: Shopify?.currency?.active ?? "USD", 
        value: cart.total_price 
    });
  }
}
                clearInterval(interval)
            }
        }, 500)
</script>
{% endif %}