Implementing the Complementary AI Pixel in Shopify

To ensure proper statistics counting for your reports, you must implement our AI pixel for your Shopify store.


Installation Steps

This is the way to implement it:

  1. Log into your Shopify store through the Admin account.
  2. Go to Settings.
  3. Select Customer events.
  4. Choose Add custom pixel.
  5. It's recommended to name it Flashy AI.
  6. Leave the Permissions settings as they are.
  7. In the code box, delete the default code and paste the following code:

analytics.subscribe('checkout_completed', (event) => {

  (function (a, b, c) { if (!a.flashy) { a.flashy = function () { a.flashy.event && a.flashy.event(arguments), a.flashy.queue.push(arguments) }, a.flashy.queue = []; var d = document.getElementsByTagName('script')[0], e = document.createElement(b); e.src = c, e.async = !0, d.parentNode.insertBefore(e, d) } })(window, 'script', 'https://api.thunder.flashy.dev/thunder.js'), flashy('init', __ACCOUNT_ID__);


  window.addEventListener('onFlashy', function() {
   
    let purchaseEvenet = {
    'content_ids': event.data.checkout.lineItems.map( item => item.variant.id ?? item.variant.product.id ),
    'value': event.data.checkout.totalPrice.amount,
    'currency': event.data.checkout.currencyCode,
    'order_id': event.data.checkout.order.id
    };

    console.log("Flashy Checkout Event", purchaseEvenet);

    flashy('amplify:Purchase', purchaseEvenet);
  });
 
});
  1. Crucially, within the code, ensure you change the __ACCOUNT_ID after the init function to the client's actual ID:
    ('init', \_\_ACCOUNT\_ID\_\_)


*Where to Find the Account ID?

The ACCOUNT ID is located within the client's tab in Flashy, right next to your account name.

So, for example, it should be:

('init', 377)