Adobe Analytics

Last updated

Integration of Adobe Analytics (formerly Omniture SiteCatalyst) with VWO will help you to import VWO campaign data into your Adobe Analytics account. 

The end-to-end process of integrating Adobe Analytics with VWO involves the following steps:

  1. Designating a Custom Conversion Variable
  2. Adding a Code Snippet

Designating a Custom Conversion Variable

Sign in to your Adobe Analytics account and designate a Custom Conversion variable as your optimization tracking variable.

Adding a Code Snippet

Adobe Analytics is compatible with both synchronous and asynchronous types of code.?? However, Make sure the VWO Smart Code snippet is added before s_code.js on your page.

  • Integrating using VWO Synchronous code
  • Integrating using Asynchronous VWO code

Integrating Using VWO Synchronous Code

Using Synchronous code, you can push data from multiple VWO campaigns to different custom variables. Use the following code snippet to push data from multiple VWO campaigns to different custom variables (eVar):

var _vis_opt_queue = window._vis_opt_queue || [], _vis_counter = 0;
_vis_opt_queue.push(function() {
try {
if(!_vis_counter) {
var _vis_data = {},_vis_combination,_vis_id,_vis_l=0;
for(;_vis_l<_vwo_exp_ids.length;_vis_l++) {
_vis_id = _vwo_exp_ids[_vis_l]; // test id
if(_vwo_exp[_vis_id].ready) {
_vis_combination = _vis_opt_readCookie('_vis_opt_exp_'+_vis_id+'_combi');
if(typeof(_vwo_exp[_vis_id].combination_chosen) != "undefined")
_vis_combination = _vwo_exp[_vis_id].combination_chosen;
if(typeof(_vwo_exp[_vis_id].comb_n[_vis_combination]) != "undefined") {
switch (_vis_id) { //_vis_id is the test id
case 1: s.eVar55 = _vis_id + ":" + _vwo_exp[_vis_id].comb_n[_vis_combination];    break;
case 2: s.eVar56 = _vis_id + ":" + _vwo_exp[_vis_id].comb_n[_vis_combination]; break;
default: s.eVar55 = _vis_id + ":" + _vwo_exp[_vis_id].comb_n[_vis_combination]; break;
catch(err) {};

“Case 1 and Case 2 in this code represent the campaign IDs for which you want to collect data. After the code snippet executes, the data for the variation combinations corresponding to the respective campaigns starts getting updated.
ATTENTION If you have deployed Adobe Analytics using Adobe Dynamic Tag Management (DTM) and used its automatic configuration, it will allow DTM to manage the AppMeasurement code, so the “s_code.js” file won’t be created. But DTM provides the option to customize the page code, wherein you can enter Javascript calls.

Integrating Using Asynchronous VWO Code

Integrating Adobe Analytics using the Asynchronous VWO code requires extra calls to be made to the Adobe Analytics servers because it involves events to update the servers. Add the following Asynchronous code below the s_code.js file to push data from multiple campaigns into different custom variables (eVar):

<script type="text/javascript">
_var vis_opt_queue = window._vis_opt_queue || [], _vis_counter = 0;
_vis_opt_queue.push(function () {
try {
if (!_vis_counter) {
var _vis_data = "", _vis_combination;
_vis_combination = _vis_opt_readCookie('_vis_opt_exp_' + _vis_opt_experiment_id + '_combi');
if (typeof (_vwo_exp[_vis_opt_experiment_id].combination_chosen) != "undefined") _vis_combination = _vwo_exp[_vis_opt_experiment_id].combination_chosen;
if (typeof (_vwo_exp[_vis_opt_experiment_id].comb_n[_vis_combination]) != "undefined") {
_vis_data = 'VWO-' + _vis_opt_experiment_id + ':' + _vis_opt_comb_name[_vis_combination];
_vis_counter = 1;
if (_vis_counter && _vis_data != "") {
var s = s_gi(window.s.account || s_account);
s.linkTrackEvents = "None";

switch (_vis_opt_experiment_id) {
Case 1:
s.linkTrackVars = 'eVar55';
s.eVar55 = _vis_data;, 'o', 'VWO Tracking'); break;
Case 2:
s.linkTrackVars = 'eVar56';
s.eVar56 = _vis_data;, 'o', 'VWO Tracking');break;
s.linkTrackVars = 'eVar66';
s.eVar66 = _vis_data;, 'o', 'VWO Tracking');break;
} catch (err) {};

SPA Integration

For any SPA integration with VWO, you must add the following code snippet to the website, anywhere between <head> </head> elements, but before the second code snippet. This code is common for all SPA integration and must be installed only once even if you have multiple tools to integrate. For example, you may want to integrate both Omniture and Mixpanel.

<script type="text/javascript">
!function(v,w,o){var e=[],t=[],z=function(n,a){a.e===n[0]&&a.c.apply(this,[n])},u=function(n,a){a.e&&a.e!==n[1]||a.v&&a.v!==n[2]||a.c.apply(this,[n])},c=function(n){for(var a=0;a<t.length;a++)z(n,t[a]);if("rH"===n[0]||"vS"===n[0])for(a=0;a<e.length;a++)u(n,e[a])},r=w.push;w.push=function(){var n=arguments[0];c(n),r.apply(w,[]},v.onVariationApplied=function(n,t,s){"function"==typeof n&&(s=n,n=null,t=null),s=s||o;var c={e:n,v:t,c:s};e.push(c);for(var r=0;r<w.length;r++)("rH"===w[r][0]||"vS"===w[r][0])&&u(w[r],c)},v.onEventReceive=function(n,e){e=e||o;var s={e:n,c:e};t.push(s);for(var c=0;c<w.length;c++)u(w[c],s)}}(window.VWO=window.VWO||[],window._vwo_evq=window._vwo_evq||[], function(){});</script>

In Addition to the code above, you must add the following additional code for Adobe Omniture. 

<script type="text/javascript">
(function () {
var WAIT_TIME = 100,
var getAccount = function () {
// Change the variable according to your page
return window.s_gi(window.s_account || window.s.account);

// All tracking variable will be contained in this array
var v = [];
v.add = function (w, o) {
getAccount()[w] = o;

// Function to send data to Omniture backend
var sendData = function () {
var s = getAccount();
s.linkTrackVars = v.join(',');, 'o', 'VWO Tracking');
v.splice(0, v.length);
window.VWO.push(['onVariationApplied', function (data) {
if(!data) {
var expId = data[1],
variationId = data[2];

if (expId && variationId) {
// Add the variable (eVar) name and it's value here.
// In case you have multiple campaigns and you want to send the data to different eVars, add a switch case here
v.add('eVar53', 'VWO-' + expId + ':' + _vwo_exp[expId].comb_n[variationId]);

// Only send if data is available
if(v.length) {
// We are using setTimeout so that all experiment can be sent in just one call to Omniture
dataSendingTimer = setTimeout(sendData, WAIT_TIME);

Contact Us / Login

Resources Home