How to target cart information and past orders

This feature requires basic knowledge of Javascript in order to complete.

 

SHOPIFY CUSTOMERS: Please use this article to set up this feature instead

We have relatively easy to use targeting conditions for cart and orders in our advanced targeting rules under the "Cart and Past Order Rules" tab. To set these up you will need some javascript knowledge to add the following javascript code snippet so that it fires whenever your user adds an item to the cart. Once you have added the correct values for your website, please add the code right below the Justuno embed code! 

<script>
   window.juapp=window.juapp||function(){(window.juapp.q=window.juapp.q||[]).push(arguments)}

   /* 
   replace the [...] portions below with the actual item information being added to cart. You can omit any of the attributes that you don't have values other then the item id and quantity. */ juapp('cartItemAdd','[item id]',{name:'[item name]',quantity:[item quantity],price:[item price],color:'[item color]',size:'[item size]'}); /* While not required, the following code will make this more accurate by communicating to justuno when a user removes an item from their cart. Uncomment and replace the [item id] if the next line to use and only fire this code when your user removes the item from their cart. */ juapp('cartItemRemove','[item id]'); </script>

In order to target users based on past orders, you will first need to add the following javascript code snippet so that it fires whenever a purchase has been successfully completed (thank you page).

<script> 
   window.juapp=window.juapp||function(){(window.juapp.q=window.juapp.q||[]).push(arguments)}

   /* 
   replace the [...] portions below with the actual order information about order. You can omit any of the attributes that you don't have values other then the order id and order total. */ juapp('order','[order id]',{total:[order total],subtotal:[order subtotal],tax:[order tax],shipping:[order shipping]}); /* replace the [...] portions below with the actual item information in order. You can omit any of the attributes that you don't have values other then the item id and quantity. You will need to repeat this line of code for each item in the order. */ juapp('orderItem','[item id]',{name:'[item name]',quantity:[item quantity],price:[item price],color:'[item color]',size:'[item size]'}); </script>
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Alex Pearson

    Hi I'm using Squarespace, and can't get the Cart Information to pass to Just Uno in my testing. www.familytreedesign.net

  • 0
    Avatar
    Yuno

    Hey Alex!

    Thanks for reaching out. Since this section is tied to custom site information, it would require use to review and supply custom code. Not something we do unless tied to a managed account.

    Happy to review what you have to point you down the best direction. I've sent out an email to request the snippet of code you are using and where you are placing this.

    I look forward to your response. 

    Thanks,

    Yuno

Please sign in to leave a comment.