The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.
Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

Tags

How to set tags in Optimizely Web Experimentation.

Tags are contextual metadata about pages and events. They identify what a user is looking at, clicking on, or interacting with. For example, you can use tags to describe a product being purchased, an article being read, or a flight being booked. See Tags: Describe key elements on your site.

The following are three ways to capture this context:

  • Directly on an event, using the tags property.
  • Directly on a page, using the tags property. These tags are sent along with any event that happens on that page.
  • The tags method to add context without activating a page and tracking a pageview. This is equivalent to the previous option, but can be used when pages are already being activated using URL targeting.

Syntax

window["optimizely"].push(tag);

Parameters

Parameter and TypeChild AttributeDescription
tag
TagObject
N/AThis is a tag object.
type
string
Child attribute of type TagObject.This is a static value that indicates that you are using the tag function. Required.
tags
PageTag
Child attribute of type TagObject.A single-level JSON object with metadata. This is equivalent to page tags, but it can be used when pages are already being activated using URL targeting.
*
string or integer
Child attribute of type PageTag.You can specify additional properties of your choice.

Example call

window["optimizely"].push({
  "type": "tags",
  "tags": {
    "category": "Kitchen",
    "subcategory": "Blenders",
    "price": 64999,
    "sku": 113757
  }
});