Integrating Popin Sales Tracking on Shopify
To ensure seamless sales tracking with Popin, please follow the steps below to integrate the new Popin sales tracking pixel into your Shopify store.
Steps to Integrate Popin Sales Tracking
Step 1: Access Your Shopify Admin Panel
- Log in to your Shopify account.
- From the Shopify admin dashboard, navigate to the Settings section located at the bottom-left corner of the page.
Step 2: Navigate to Customer Events
- In the Settings menu, find and select Customer Events from the list.
Step 3: Add the Custom Pixel
- Click on the Add Custom Pixel button.
- In the dialog box that appears, enter the following details:
- Name:
popin_saletrack - Code: Copy and paste the following script, ensuring to replace
YOUR_SELLER_ID with your unique seller ID from your Popin dashboard:
- const popinSalesTracker = async ({ sellerId, orderId, amount }) => {
- var popinDomain = "https://widget01.popin.to";
- var popinUserData = await localStorage.getItem("popinUserData");
- if (popinUserData) {
- popinUserData = JSON.parse(popinUserData);
- fetch(popinDomain + "/api/v1/user/sale", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Authorization: `Bearer ${popinUserData.popInToken}`,
- },
- body: JSON.stringify({
- seller_id: sellerId,
- order_id: orderId,
- amount: amount,
- }),
- });
- }
- };
- analytics.subscribe("checkout_completed", (event) => {
- popinSalesTracker({
- sellerId: YOUR_SELLER_ID, // Replace with your seller ID
- orderId: event.data?.checkout?.order?.id,
- amount: event.data?.checkout?.totalPrice?.amount
- });
- });
Step 4: Save Your Changes
- Once you've entered the name and code, click the Save button to activate the new pixel.
Step 5: Verify Integration
- After saving, it’s important to verify that the Popin sales tracking is functioning correctly. You can do this by making a test purchase and checking if the tracking data is recorded properly in your Popin dashboard.