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.

Google Optimize intergration

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

  1. Click Add filter, and then the ‘+’ button:

    Google Optimize Intergration
  2. Choose Custom property and find your property on the list:

    Google Optimize Intergration
  3. Choose a value (e.g., the ID of the experiment) and click on Apply filters:

    Google Optimize Intergration

Didn’t find an answer?

Try using the search engine or just contact us

hello@livesession.ioChat with us

Start using LiveSession for free now.

Free 14-day trial

No credit card required

Easy setup