Skip to main content
Contributor I
March 27, 2024
Solved

Klaviyo and Magento 2 Integration Error: require is not defined

  • March 27, 2024
  • 2 replies
  • 233 views

So I’m currently helping a brand installing Klaviyo extension for their Magento 2 website. I sent them this guideline to install https://help.klaviyo.com/hc/en-us/articles/115005254348. They already finished the installation and setup, and contacts as well as Magento metrics have synced to Klaviyo.
 

However, there are 2 metrics, Viewed Product and Active on site are not being tracked. I checked for console on a product page and see this error “require is not defined” as below:


Not sure what would cause this error and how to fix it. Since I don’t have access to their Magento server so I have to tell their devs on how to fix it. This is an example product page that shows the error for their site btw https://yvesrocher.vn/vn/anti-age-global-night-care-pot-50ml-y119896.html.

    This topic has been closed for replies.
    Best answer by Omar

    Hi @alvin.nguyen,

    I would suggest checking the network tab to see if this event is fired and if not domReady seems like something you'd use with Google tag manager.

    In such a case I'd doublecheck if the event is firing in GTM.

     

    Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

    We help with e-commerce growth through CRO, Klaviyo and CVO

     

    2 replies

    Brian Turcotte
    Klaviyo Alum
    March 29, 2024

    Hi @alvin.nguyen!

    I see that you have filed a ticket with Support for this issue, which would have been my recommended course of action given that this appears to be an isolated, account-specific issue.

     

    Best,

    Brian

    Omar
    Partner - Platinum
    OmarAnswer
    2025 Champion
    March 30, 2024

    Hi @alvin.nguyen,

    I would suggest checking the network tab to see if this event is fired and if not domReady seems like something you'd use with Google tag manager.

    In such a case I'd doublecheck if the event is firing in GTM.

     

    Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

    We help with e-commerce growth through CRO, Klaviyo and CVO

     

    Helping E-commerce brands maximize Lifetime Value & Profits with Klaviyo, CRO & CVO - Get your free Audit - https://link.polarisgrowth.com/free-audit