This website works best with JavaScript enabled. Learn how to enable JavaScript.

Hubspot

Last updated

If you are using Hubspot to collect your website data, integrating with VWO will help you collect visitor data of your landing page and also of all variations you create in your VWO tests. You can use this data to compare variations, get deeper insights from your VWO test, and implement changes that boost your conversions.

ATTENTION To enable this integration, you need to ensure that both VWO tracking code and Hubspot tracking code are enabled on your website.
The end-to-end process of integrating Hubspot  with VWO involves the following steps:

  1. Enabling Hubspot Integration
  2. Viewing Events

Enabling Hubspot Integration

Follow the the steps below to enable Hubspot Integration:

  1. Sign in to Hubspot Dashboard.
  2. Select the Reports drop-down menu on your hubspot dashboard and then select Events.untitled_drawing
  3. Select Customize JavaScript.

untitled_drawing__1_

  1. In the displayed text box, paste the following javascript and then click Add New Custom Script. Remove any pre-existing code snippet on the Custom JavaScript section before pasting the code.
    
    

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

    var _vis_counter = 0;

    window._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];

          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') {

            

              _vis_data.push({

                id: _vis_id,

                name: _vwo_exp[_vis_id].name,

                type: _vwo_exp[_vis_id].type,

                combination_chosen: _vwo_exp[_vis_id].comb_n[_vis_combination]

              });

              _vis_counter++;

            }

          }

        }

        // Use the _vis_data object created above to fetch the data,

        // key of the object is the Test ID and the value is Variation Name

        var _vis_l=0;

        for(;_vis_l < _vis_data.length;_vis_l++) {

          var _vis_id = _vis_data[_vis_l].id, _combination_chosen = _vis_data[_vis_l].combination_chosen, _camp_name = _vis_data[_vis_l].name;

          window._hsq = window._hsq || [];

          window._hsq.push(function(t) {

              t.trackEvent({ id: "vwo_"+_camp_name+"_"+_combination_chosen , value: null });

          });

        }  

      }

    }

    catch (err) {

    };

     });

Viewing Events

Go to the Reports section to view the events created in Hubspot to capture your VWO data.untitled_drawing__2_

Was this article helpful?

Thanks for your feedback!
Please email us at support@vwo.com to tell us what you were looking for. We'll send the answer to your inbox.

Contact Us / Login