Rich-text Reply
Highlighted

Segment audience by age

Becj 08-09-19

Segment audience by age

Hi, I'm trying to test different content based on the age of visitors to our site. Specifically content targeted at over 65s. But it's not one of the standard audience attributes available (don't have Optimizely personalization). Is there a workaround e.g. by creating a custom attribute?

Level 2

0 Likes
0 Likes
CouchPsycho 08-12-19
 

Re: Segment audience by age

Hi,

how should "optimizely" know the age of your visitor? ;-) If you have got this kind of information on your site or in your data layer you may use an anonymous function to create an audience condition:

 

(function()
{
var userAge = theVariableWhichIsSomewhereStoredAndAccessible;

if ( userAge >= 65 )
{
return true;
}
else
{
return false;
}
})();

 

Kind regards

Michael


   
0 Likes
0 Likes
JDahlinANF 08-12-19
 

Re: Segment audience by age

[ Edited ]

edit - posted under wrong account

 

0 Likes
0 Likes
JasonDahlin 08-12-19
 

Re: Segment audience by age

^--- What he said

Also, if you want the experiment to run on page load without any flashing, you'll want to make sure this variable is set in the HTML above Optimizely.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy


Experimentation Hero
0 Likes
0 Likes