Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
ExperimentSelector.gif
README.md
analytics_logo.png
experiment-selector.html

README.md

Google Analytics Experiments selector

Google Analytics Experiments selector is a selector connected to Google Analytics instance which allows users to select an experiment and its variant.

Google Analytics Experiment selector

Usage

If you want to use the Google Analytics Experiment selector in your project in Kentico Cloud, follow these steps:

{
  "clientId": "<YOUR GOOGLE APP CLIENT ID>.apps.googleusercontent.com",
  "accountId": "<YOUR GOOGLE ANALYTICS ACCOUNT ID>",
  "webPropertyId": "<YOUR GOOGLE ANALYTICS PROPERTY ID>",
  "profileId": "<YOUR GOOGLE ANALYTICS PROFILE ID>"
}

Example output

The element will save a value containing the experiment/variant identifier as well as metadata need for first display of the selector.

[
  "YI5uxeAkRZ-0E1-7oQ5FXg/2",
  {
    "experiment": {
      "id": "YI5uxeAkRZ-0E1-7oQ5FXg",
      "key": "190562962-3",
      "name": "Home page A/B test"
    },
    "variant": {
      "id": "2",
      "name": "Try Premium"
    }
  }
]

The experiment/variant identifier is at the beginning of the value so that the content items can be filtered based on the prefix of the value.

Installation

Google Analytics Experiment selector source code is in following repository: https://github.com/Kentico/cloud-custom-element-sample-ga-experiments

If you want to adjust the implementation, first download Kentico Cloud Custom Elements Devkit. Source code of this selector needs be positioned within /client/custom-elements folder. For further instructions on devkit implementation, please refer to Custom Element Devkit README.

Analytics

You can’t perform that action at this time.