Skip to main content

Hello everyone,

I'm setting up the integration in Salesforce (SiteGenesis) following the document How to Integrate with Salesforce Commerce Cloud (https://help.klaviyo.com/hc/en-us/articles/360033744951-How-to-Integrate-with-Salesforce - Commerce-Cloud).

Everything seems to work correctly, most events are triggered and captured from Klaviyo's side. Except the cart events.

According with doc:
2. I have to include the following code in the minicart.isml, cart.isml and any other "cart" isml files the site uses:

<isif condition="${pdict.CurrentHttpParameterMap.cartAction == 'add' || pdict.CurrentHttpParameterMap.cartAction == 'update'}">
  <isinclude url="${URLUtils.url('Klaviyo-RenderKlaviyoAddToCart')}"/>
</isif>

So, I have realized that klaviyo.js already has been included by other file on previous step:
1. Add the following code to the bottom of your footer_UI.isml file:

<isinclude template="components/footer/klaviyoFooter"/>

Therefore, I am getting warning in browser console when cart page is loading:
It is not possible to upload klaviyo.js multiple times for the same site. Ignoring account "xxxxxx". The active account is "xxxxxx"

Meanwhile, I did not receive any data on Klaviyo dashboard.

Have Someone ever gotten this issue?

Hello @luiz.menescal@improove.pt,

Thanks for sharing this with the Community.

Can you inspect the code on your page and search for duplicate instances of Klaviyo’s onsite js? This sounds like it may be the cause of both the warning and the result of Salesforce Commerce Cloud metrics not recording in your Klaviyo account. If this was the issue, please contact support to remove the duplicate script. If not, please let us know here and we can take next steps. 


Hello @luiz.menescal@improove.pt,

Thanks for sharing this with the Community.

Can you inspect the code on your page and search for duplicate instances of Klaviyo’s onsite js? This sounds like it may be the cause of both the warning and the result of Salesforce Commerce Cloud metrics not recording in your Klaviyo account. If this was the issue, please contact support to remove the duplicate script. If not, please let us know here and we can take next steps. 

 

Hi Dov.Derin, thanks for your reply.
I know where it's duplicated. According to the guide, I must add a klaviyoFooter include to footer.isml. This klaviyoFooter has a call to klaviyo.js (this is the first time call).
This footer.isml is included on most pages, even this cart page (cart.isml). So, still according to the guide, also I must add a code snippet in cart.isml <isinclude url = "${URLUtils.url('Klaviyo-RenderKlaviyoAddToCart')}" />. In this code, there is also a call to klaviyo.js.
Since cart.isml also uses footer.isml, we will have a duplicate call to klaviyo.js.
I hope I'm clear! =)
Thks


@luiz.menescal@improove.pt I don’t believe the duplicate JS will prevent anything from functioning properly. Are you able to see that _learnq is defined in the console after adding something to your cart? Can you check if there is a klParsedData object defined in the console if _learnq is defined to see if there is any relevant data about what event Klaviyo is tracking?


Reply