Rich-text Reply

Custom Attributes for Repoing Segmentation

AlexCox6 2w ago

Custom Attributes for Repoing Segmentation

Hi All, 


I am trying to use Custom Attributes to help with the segmentation in reporting but cant see the option in the results. 


I have added the following to the variation code editor of my experience 


// This line is required if the custom event is triggered before Optimizely is defined on the page or if triggered in Project JavaScript
window.optimizely = window.optimizely || [];

"type": "user",
"attributes": {
"Page-Type": "1.1 Home Page",
"customAttributeApiName": "page_type"


I have a different page type for each of my page variations. 


When I look in results I don't have any option for the Custom Attribute. 


I raised a ticket with Optimizely support yesterday but as I am yet to get a response I thought I would post here to see if someone else could assist 

Level 2

Re: Custom Attributes for Repoing Segmentation

[ Edited ]

Hi Alex,

I found the ticket you raised and it has been responded to.
The script you are using above is not correct.

You only need to specify one key value pair e.g. key name "page_type" and the value is "1.1 home page". The key needs to be the API name of the custom attribute (not the display name) and the value can be any string.


window["optimizely"] = window["optimizely"] || [];
"type": "user",
"attributes": {
"page_type": "1.1 Home Page"

I checked your experiment results page and can confirm this attribute is showing up in segmentation.

If you have any further questions please respond within the ticket.

Mansoor Omar
Support Tech Lead