Many Shopify merchants use the Zipify OneClickUpsells (OCU) app in their stores to increase customer Average Order Value. ShopMessage works well with OCU, but requires a bit of configuration.

Why You Need an Integration with OCU

ShopMessage works by first tracking actions your customers take on your site via ViewProduct , UpdateCart , and PurchaseComplete  events. Usually PurchaseComplete  works automatically when using the native Shopify Checkout. However, when using OCU, you will need to configure OCU to send the PurchaseComplete  events when users land on an Upsell or Thank You page.

Step by Step Instructions

1. Find your store's ShopMessage ID.

Log into your ShopMessage dashboard and find your unique ShopMessage ID from the URL bar. You need to copy this letter/number combination.

2. Log in to Zipify OCU and open the settings page.
Click on General and scroll down to Additional Scripts.

3. First Upsell Page Scripts field
Copy the code below and paste into the First Upsell Page Scripts field. Be sure to paste your ShopMessage ID where it says <REPLACE WITH YOUR SHOPMESSAGE ID> .

<!-- SHOPMESSAGE SCRIPT for First Upsell Page to track initial conversion -->
<script type="text/javascript">
var siteHash = "<REPLACE WITH YOUR SHOPMESSAGE ID>";

window.lightningjs||function(d){var w="lightningjs";function e(e,t){var a,v,g,n,r,i;return t&&(t+=(/\?/.test(t)?"&":"?")+"lv=1"),de]||(a=window,v=document,g=e,n=v.location.protocol,r="load",i=0,function(){d[g]=function(){var e=arguments,t=this,o=++i,n=t&&t!=a&&t.id||0;function s(){return s.id=o,d[g].apply(s,arguments)}return(m.s=m.s||[]).push([o,n,e]),s.then=function(e,t,n){var a=m.fh[o]=m.fh[o]||[],r=m.eh[o]=m.eh[o]||[],i=m.ph[o]=m.ph[o]||[];return e&&a.push(e),t&&r.push(t),n&&i.push(n),s},s};var m=d[g]._={};function e(){m.P(r),m.w=1,d[g}m.fh={},m.eh={},m.ph={},m.l=t?t.replace(/^\/\//,("https:"==n?n:"http:")+"//"):t,m.p={0:+new Date},m.P=function(e){m.pe]=new Date-m.p[0]},m.w&&e(),a.addEventListener?a.addEventListener(r,e,!1):a.attachEvent("on"+r,e);var f=function(){function t(){return["<head></head><",e,' onload="var d=',h,";d.getElementsByTagName('head')[0].",r,"(d.",i,"('script')).",o,"='",m.l,"'\"></",e,">"].join("")}var e="body",n=v[e];if(!n)return setTimeout(f,100);m.P(1);var a,r="appendChild",i="createElement",o="src",s=v[i,d=sr),c=vi,h="document",p="domain",l="contentWindow";s.style.display="none",n.insertBefore(s,n.firstChild).id=w+"-"+g,c.frameBorder="0",c.id=w+"-frame-"+g,/MSIE ]+6/.test(navigator.userAgent)&&(c[o]="javascript:false"),c.allowTransparency="true",d[r;try{c[l][h].open()}catch(e){m[p]=v[p],a="javascript:var d="+h+".open();d.domain='"+v.domain+"';",c[o]=a+"void(0);"}try{var u=c[l][h];u.write(t()),u.close()}catch(e){c[o]=a+'d.write("'+t().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}m.P(2)};m.l&&f()}()),d[e].lv="1",d[e]}var t=window[w]=e(w);t.require=e,t.modules=d}({}),window._shopmsg=lightningjs.require("_shopmsg","https://cdn.shopmsg.me/v1.0/shopmsg_sdk.js?c=1fca18c8100084a67a14d2a5618a9aec57127882"),function(e,t,n){var a,r=e.getElementsByTagName(t)[0];e.getElementById(n)||((a=e.createElement(t)).id=n,a.src="https://cdn.shopmsg.me/platform/" + siteHash + "/v1.0/initialize.js?c=1fca18c8100084a67a14d2a5618a9aec57127882",r.parentNode.insertBefore(a,r))}(document,"script","shopmsg-jssdk");

_shopmsg('trigger', 'PurchaseComplete', {
  "order_id": "{{ 'now'|date:'%s' }}", // required
  "currency": "{{ shop.currency }}",
  "total_price": {{ total_price | money_without_currency }},
  "subtotal_price": {{ subtotal_price | money_without_currency }},
  "total_tax": {{ tax_price | money_without_currency }},
  "shipping_price": {{ shipping_price | money_without_currency }},
  "shipping_address" {{ shipping_address | money_without_currency }},
  "customer_properties": {
    "email": "{{ checkout.email }}",
    "first_name": "{{ customer.first_name }}",
    "last_name": "{{ customer.last_name }}"
  },
  "items" : "{{ checkout.line_items}}",
  "platform": "ZipifyOCU"
});
</script>
<!-- END SHOPMESSAGE -->


4. Thank You Page Script field
Copy the code below and paste into the Thank You Page Script field. Be sure to paste your ShopMessage ID where it says <REPLACE WITH YOUR SHOPMESSAGE ID> .

{% if checkout.offers_bought %}
<!-- SHOPMESSAGE SCRIPT for THANK YOU PAGE to track UPSELLS conversion -->
<script type="text/javascript">
    var siteHash = "<REPLACE WITH YOUR SHOPMESSAGE ID>";
    window.lightningjs||function(d){var w="lightningjs";function e(e,t){var a,v,g,n,r,i;return t&&(t+=(/\?/.test(t)?"&":"?")+"lv=1"),de]||(a=window,v=document,g=e,n=v.location.protocol,r="load",i=0,function(){d[g]=function(){var e=arguments,t=this,o=++i,n=t&&t!=a&&t.id||0;function s(){return s.id=o,d[g].apply(s,arguments)}return(m.s=m.s||[]).push([o,n,e]),s.then=function(e,t,n){var a=m.fh[o]=m.fh[o]||[],r=m.eh[o]=m.eh[o]||[],i=m.ph[o]=m.ph[o]||[];return e&&a.push(e),t&&r.push(t),n&&i.push(n),s},s};var m=d[g]._={};function e(){m.P(r),m.w=1,d[g}m.fh={},m.eh={},m.ph={},m.l=t?t.replace(/^\/\//,("https:"==n?n:"http:")+"//"):t,m.p={0:+new Date},m.P=function(e){m.pe]=new Date-m.p[0]},m.w&&e(),a.addEventListener?a.addEventListener(r,e,!1):a.attachEvent("on"+r,e);var f=function(){function t(){return["<head></head><",e,' onload="var d=',h,";d.getElementsByTagName('head')[0].",r,"(d.",i,"('script')).",o,"='",m.l,"'\"></",e,">"].join("")}var e="body",n=v[e];if(!n)return setTimeout(f,100);m.P(1);var a,r="appendChild",i="createElement",o="src",s=v[i,d=sr),c=vi,h="document",p="domain",l="contentWindow";s.style.display="none",n.insertBefore(s,n.firstChild).id=w+"-"+g,c.frameBorder="0",c.id=w+"-frame-"+g,/MSIE ]+6/.test(navigator.userAgent)&&(c[o]="javascript:false"),c.allowTransparency="true",d[r;try{c[l][h].open()}catch(e){m[p]=v[p],a="javascript:var d="+h+".open();d.domain='"+v.domain+"';",c[o]=a+"void(0);"}try{var u=c[l][h];u.write(t()),u.close()}catch(e){c[o]=a+'d.write("'+t().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}m.P(2)};m.l&&f()}()),d[e].lv="1",d[e]}var t=window[w]=e(w);t.require=e,t.modules=d}({}),window._shopmsg=lightningjs.require("_shopmsg","https://cdn.shopmsg.me/v1.0/shopmsg_sdk.js?c=1fca18c8100084a67a14d2a5618a9aec57127882"),function(e,t,n){var a,r=e.getElementsByTagName(t)[0];e.getElementById(n)||((a=e.createElement(t)).id=n,a.src="https://cdn.shopmsg.me/platform/" + siteHash + "/v1.0/initialize.js?c=1fca18c8100084a67a14d2a5618a9aec57127882",r.parentNode.insertBefore(a,r))}(document,"script","shopmsg-jssdk");
   
    _shopmsg('trigger', 'PurchaseComplete', {
      "order_id": "{{ order_id }}", // required
      "currency": "{{ shop.currency }}",
      "total_price": {{ total_price | money_without_currency }},
      "platform": "ZipifyOCU"
    });
    </script>
<!-- END SHOPMESSAGE -->
{% endif %}


5. That's it!
You can test your integration by opening the Live View in your ShopMessage dashboard, making a test purchase through OCU and verifying that the PurchaseComplete  event appears.

Have any questions? Reach out to us using the Intercom chat bubble in the bottom right.

Did this answer your question?