Google Optimize is an Experimentation platform that offers the ability to test out variants of web pages and see how they perform based on specified goals. Here is how you can integrate the data you capture in Optimize into your FullStory account.
Getting Started with Google Optimize
To ensure you can utilize Google Optimize, you’ll need the Google Optimize extension installed. Follow these steps in Google Optimize to get started:
- The first step in this process is to set up an Experiment in your Google Optimize container.
- You’ll choose from a variety of options but for the purposes of this article, the focus will be on A/B testing.
- From here, you will set up variations you wish to test based on the objective you have set out to accomplish.
- Verify the installation of the Google Optimize script.
For a more in depth look at setting up a Google Optimize account and setting up experiments in more detail, please review Google’s documentation here.
Integrating with FullStory
Once you've set up your Google Optimize account with experiments and variables in place, you will then be ready to set up your manual integration in FullStory.
Note: You will need a Google Analytics account to complete this integration.
Below are the next steps to take. It is worth noting that these can be completed via a tag manager (Google Tag Manager, etc).
- In your development environment, add the FullStory data capture snippet in the <head> section of your site.
- Add your Google Analytics account script to the same section of your site.
- Add the Google Optimize experiment script to this section of your site.
- Copy + Paste the below
optimize.callback
handler just before the</body> tag:
Note: The code below must be placed after FullStory's data capture snippet (from step 1) in order for FS.event
to work as expected.
<script>
window.gtag = window.gtag || function() {
dataLayer.push(arguments);
};
function captureFSEvent(value, name) {
FS.event('Optimize Experiment', {
experiment_name_str: name,
variation_value_str: value
});
}
gtag('event', 'optimize.callback', {
callback: captureFSEvent
});
</script>
Additional Resources
Here are some additional resources from Google that are helpful for guidance around Google Optimize usage.