LiveSession and Google Optimize integration
What is Google Optimize?
Google Optimize is a tool to learn about your users by running A/B tests. This is crucial to understand your visitors and customize website content to improve conversions. LiveSession provides this integration to help you add a qualitative context to your A/B tests.
How does this integration work?
When you start your A/B test and implement the code below, every new session in LiveSession will contain two custom properties: experimentID
and variant
. You can hover your mouse cursor over properties on the session list to preview them.
Not sure how to filter custom properties? You’ll find a tutorial at the end of this article.
How to install this integration?
Copy the following code, and paste it into the </body>
section of your website:
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("event", "optimize.callback", {
callback: function (value, name) {
__ls("setCustomParams", {
params: {
experimentID: name,
variant: value,
},
});
},
});
</script>
Filter custom properties
Click Add filter, and then the ‘+’ button:
Choose Custom property and find your property on the list:
Choose a value (e.g., the ID of the experiment) and click on Apply filters: