Overview

Visual Website Optimizer (VWO) scripts should be inserted in the "Additional Scripts" field(s) of the OCU app found at Settings > General > Advanced Settings > Additional Scripts. 

Scripts inserted into the First Upsell Page Scripts field will fire on the first post-purchase offer page. This will allow you to track the initial order conversion and other order data in 3rd party analytics.

Scripts inserted into the Thank You Page Scripts field will fire on the final Thank You page. Use this to track all upsell/downsell offer data in 3rd party analytics.

These scripts will be loaded on the first offer page and TY page respectively, but conversion data tracking in your VWO account will be updated only after you create a rule taking into account the OCU checkout and offer page(s) URL structure. 

Create conversion tracking for OCU checkout and offer pages

Create tracking for the initial checkout purchase

Information about revenue received from the initial checkout will be passed.

Within your VWO account, create tracking with the following conditions:

  • Set Advanced settings and URL matches regex 
  • Paste the following URL into the included URL(s) field:
/apps/secure-checkout/offers\/.+\?offers_status=0
  • Paste the URL appropriate for your test requirements into the second field to generate your heatmap reports. OCU pages can't be used for this field.  
  • Set a ‘tracks revenue on’ goal and URL matches regex
  • Paste the following URL into the field:
/apps/secure-checkout/offers\/.+\?offers_status=0

Create tracking for upsell purchase(s)

 Information about revenue received from upsell product purchase(s) will be passed.

Within your VWO account, create tracking with the following conditions:

  • Set Advanced settings and URL matches regex
  • Paste the following into the into Included URL(s) field:
(\/apps\/secure-checkout\/offers\/.+\?offers_status=1|\/apps\/secure-checkout\/thank_you\/.+\?offers_status=1)
  • Paste the URL appropriate for your test requirements into the second field to generate your heatmap reports. OCU pages can't be used for this field. 
  • Set a ‘tracks revenue on’ goal and URL matches regex
  • Paste the following into the field: 
(\/apps\/secure-checkout\/offers\/.+\?offers_status=1|\/apps\/secure-checkout\/thank_you\/.+\?offers_status=1)

Then repeat this process for the Upsell 2 and Upsell 3 using the following RegEx codes:

2 Upsell products purchased

(\/apps\/secure-checkout\/offers\/.+\?offers_status=2|\/apps\/secure-checkout\/thank_you\/.+\?offers_status=2)

3 Upsell products purchased

\/apps\/secure-checkout\/thank_you\/.+\?offers_status=3

Create tracking for downsell purchase(s).

Information about revenue received from the downsell product will be passed.

Within your VWO account, create tracking with the following conditions:

  • Set Advanced settings and URL matches regex
  • Paste the following into the Included URL(s) field:
\/apps\/secure-checkout\/thank_you\/.+\?offers_status=4
  • Paste the URL appropriate for your test requirements into the second field to generate your heatmap reports. OCU pages can't be used for this field.   
  • Set a ‘tracks revenue on’ goal and URL matches regex
  • Paste the following into the field: 
\/apps\/secure-checkout\/thank_you\/.+\?offers_status=4

Then repeat this process for the Downsell 2 using the following RegEx code:

\/apps\/secure-checkout\/thank_you\/.+\?offers_status=5

 Notes:

  1. VWO can’t verify that code is installed on these pages because OCU's page URLs are not static. They are dynamic because of the unique token that is used. Don’t worry if you see the following situation in your OCU tracking setup: 

Adding VWO scripts on OCU pages:

Within the OCU app, paste your VWO smart code AND revenue tracking code into the First Upsell Page Scripts "Additional Scripts" field in the Settings > General > Advanced Settings section if you want to receive information about the initial purchase. 

Below are examples of both scripts, but we advise to use scripts from your Tracking because code can be modified in the future by VWO.

Paste both scripts into the Thank You Page Scripts "Additional Scripts" field in Settings > General > Advanced Settings if you want to receive information about all post-purchase offer purchase(s).

Smart Code:

 
<!-- Start Visual Website Optimizer Asynchronous Code -->
<script type='text/javascript'>

var _vwo_code=(function(){

var account_id=123456,

settings_tolerance=2000,

library_tolerance=2500,

use_existing_jquery=false,

/* DO NOT EDIT BELOW THIS LINE */

f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();

</script>

<!-- End Visual Website Optimizer Asynchronous Code -->

Revenue Tracking Code:

<script type="text/javascript">

window._vis_opt_queue = window._vis_opt_queue || [];

window._vis_opt_queue.push(function() {_vis_opt_revenue_conversion("{{ total_price | money_without_currency }}");});

</script>
Did this answer your question?