ReferenceError: alert is not defined in Shopify Web Pixel Extension (No alert in my code)

Hi @adarsh_anncode,

Thanks for providing the link to your development store. I took a look and there are currently 3 app pixels installed on your store:

  1. Discount Kit (ID 584712360, works fine)
  2. easybulkfil_test (ID 1031897256, works fine)
  3. product-recommendation-pixel (ID 1027375272, throwing alert() error)

Looking at the JavaScript being loaded on your shop for pixel id 1027375272, we can definitely see that the pixel is calling alert():

var d = D(y => {
    "use strict";
    T();
    m(i => a(y, [i], function*({analytics: e, browser: o, settings: r}) {
        console.log("browser: ", o),
        console.log("settings: ", r),
        console.log("analytics: ", e),
        alert("Hello from the web pixel extension!")
    }))
}
);

This leads me to think that the code you shared in your initial post is not the actual code the pixel is trying to execute. I could not find any pixel code related to the page_viewed log in your example. Has the app been updated with this new code?

To continue our investigation, could you do the following:

  1. Start your local environment dev server with your custom app
  2. In your browser’s developer tools, look for your custom app in the “Sources” panel (like shown in the above screenshot)
  3. Share the code you see there
1 Like