Segment is a customer data platform (CDP) that helps every team access clean and reliable customer data to make real-time decisions, accelerate growth, and personalize experiences. It helps companies harness first-party customer data by offering a complete toolkit to standardize data collection, unify user records, and route customer data into any system where it’s needed.
Things to Consider Before you Start Integrating VWO with Segment
- Ensure that VWO supports the source type and connection mode you’ve chosen to implement. To learn more about connection modes, click here.
- Because the VWO destination needs to be on the page right away, there are two ways for the VWO Javascript snippet to be loaded on your page:
-
-
- Add the Javascript snippet directly to your codebase by following the instructions in these docs from the VWO documentation. Make sure to paste the snippet inside your <HEAD> tag above your Segment snippet!
- Have Segment include the Javascript snippet for you by toggling on the “Use Async Smart Code” setting and then including your Account ID in the “Account ID” setting. When both these settings are correctly set, you will not need to include VWO’s native snippet on your page as Segment will do this on your behalf.
Additionally, to enable the destination, follow these instructions:
- From the Segment web app, click Catalog.
- Search for “Visual Web Optimizer” in the Catalog, select it, and choose which of your sources to connect the destination to.
- Toggle the destination on!
- Add the Javascript snippet directly to your codebase by following the instructions in these docs from the VWO documentation. Make sure to paste the snippet inside your <HEAD> tag above your Segment snippet!
-
Send Experiment Data from VWO
When you enable the VWO destination, Segment sets the option for “Send experiment data to other tools (as a track call)” to true by default, and Segment will automatically collect the Experiment Viewed event as a track call.
This event supports the following semantic properties:
Property |
Type |
Description |
experimentId |
String |
The experiment’s ID. |
variationName |
String |
The variation’s human-readable name. |
Example:
analytics.track('Experiment Viewed', {
experiment_id: 'home-page-title-2819',
variation_name: 'Enterprise Solutions Synergy'
});
However, you can also send the Experiment data as traits of an identify call that can be routed to all other destinations you have enabled. You’ll just need to enable the “Send experiment data to other tools (as an identify call)” setting, and Segment will send those experiment values as traits of the user. An example would look like this:
'Experiment: Home CTA': 'Create a free account now'
Recording Variations
By default, Segment will take the variation data that is available in VWO and send that data to the other user-tracking destinations you have enabled in Segment automatically. That way, you can segment your analytics reports by the variations a user has seen.
For example, if you have an experiment called Home CTA and a visitor sees a variation called Create a free account now, we will send the Create a free account now value as the variation_name property of the Experiment Viewed event and/or as a trait of the user in an identify call (depending on your delivery settings).
Track Revenue Goals
The Track Revenue goal allows you to track revenue from purchases and other transactions on your website by attributing the revenue amount for every valid and successful transaction. In order to track these transactions, you’ll need to use the Segment's Order Completed eCommerce track event and include the revenue data as total. An example call would look like this:
analytics.track('Order Completed', {
total: 25
});
Additional settings
Make Experiment Viewed Non-interactive
If you are using VWO together with Google Analytics, you can enable this setting to add the nonInteraction flag to your Experiment Viewed track events. This can help with low bounce rates.
Library Tolerance
The maximum amount of time (in milliseconds) Segment library will wait for VWO’s full library to be downloaded before simply displaying your original page. This setting is only effective if “Use Async Smart Code” is set to “true”.
Settings Tolerance
The maximum amount of time (in milliseconds) Segment library waits for test settings before VWO will simply display your original page. This setting is only effective if “Use Async Smart Code” is set to “true”.
Use Existing JQuery
If your page already includes JQuery, you can set this to “true”. Otherwise, VWO will include JQuery onto the page for you. VWO needs JQuery on the page to function correctly. This setting is only effective if “Use Async Smart Code” is enabled.
Settings
Segment lets you change these destination settings from the Segment app without having to touch any code.
Account ID
Your VWO account ID, used for fetching your VWO async smart code. This setting is only effective if “Use Async Smart Code” is enabled.
Library Tolerance
The maximum amount of time (in milliseconds) to wait for VWO’s full library to be downloaded before simply displaying your original page. This setting is only effective if “Use Async Smart Code” is set to “true”.
Make Experiment Viewed Non-interactive
For Google Analytics users - enabling this setting will add the nonInteraction flag to your Experiment Viewed calls. This can help with low bounce rates.
Send experiment data to other tools (as a track call)
Sends the experiment and variation information as properties on a track call.
Send experiment data to other tools (as an identify call)
Sends the experiment id and variation name as traits on the identify call.
Settings Tolerance
The maximum amount of time (in milliseconds) to wait for test settings before VWO simply displays your original page. This setting is only effective if “Use Async Smart Code” is set to “true”.
Single Page Application
Enable this setting if your website is a SPA. We will configure VWO’s SDK to enable SPA on their end.
Track Only AB Experiments
Enable this setting if you only want to send to VWO events on A/B Experiments. If disabled, we’ll send events for all experiments.
Use Async Smart Code
If you would like to utilize VWO’s asynchronous smart code, toggle on this feature. This means you will not need to include VWO’s native snippet on your page as Segment will do this on your behalf. If this feature is toggled off, you will need to include VWO’s native smart code on your webpage.
Use Existing JQuery
If your page already includes JQuery, you can set this to “true”. Otherwise, VWO will include JQuery onto the page for you. VWO needs JQuery on the page to function correctly. This setting is only effective if “Use Async Smart Code” is enabled.