You can show personalization by using contextual information available for each visitor. In this article, we will see the different ways in which you can customize your personalized content to target specific visitors based on the time of the day they visited your channel or by using the information available in their browser URLs.
To use this feature, you must have Personalization library version 2.2.0 deployed on your channel.
Create your segment
Perform the following steps to create a segment using the contextual attributes:
- Open the main navigation. Go to Segments and click Create.
- Provide a name for the segment, and optionally, a short description. Click Next.
- Click Add condition to specify an inclusion or exclusion condition.
In the next sections, we will see how to use the various contextual attributes.
Personalization based on time of the day
You can display personalized content based on the real-time context of the visitor's time of the day by creating a segment for people who are visiting your channel at a certain time of the day. Note that the time value used for creating the personalization rule is as per the channel visitor’s local time zone.
When creating a segment for personalization based on the time of the day, select the following parameters for inclusion or exclusion criteria:
- Attribute: Select Contextual-Time of the day
- Operator: You can choose from before, after, or between
- Value: Depending on the option selected in the Operator, choose the time value.
Here are some examples:
- If you want to show personalized content to visitors landing on your channel after 8:30 PM, choose the options as shown.
- If you want to show specific personalized content to early birds, that is, people who visit your website early in the day (say, between 6 AM to 8 AM).
Visitors who land on your web page between 6 AM and 8 AM (and meet the inclusion criteria for the segment) will see the specific personalized content you had selected. Visitors who visit the channel at other times of the day will see either a differently personalized content or they will see the default content.
Note that this condition will be applied each day, until the rule is active on your channel.
The time is reset after 12:00 AM midnight, that is, if you specify the condition as AFTER 8:30 PM, then the personalized content will be shown from 8:31 PM to 11:59 PM, each day until the rule is active.
You can also specify multiple criteria, for example, you can create a condition to show personalized content to visitors landing on your channel BEFORE 10AM and AFTER 5 PM. In this case, the personalized content will be displayed from 00.00 to 10 AM and from 5:00 PM to 00.00, every day until the rule is active.
Personalization based on contextual URL
When we visit a web page, the browser URL contains a lot of contextual information, such as the referral sources, UTMs (urchin tracking module), tracked links, and more. You can use this information to display personalized content based on the parameters in your channel visitor’s URLs. For example, you can create a segment 'Social Media Referrals', with conditions as Contextual-URL contains "utm_source=Twitter" or "utm_source=Facebook"
To create a segment for contextual URL, select the following parameters for inclusion or exclusion criteria:
- Attribute: Select Contextual-URL
- Operator: The only option is contains
- Value: Provide the text string from the browser URL that you want match
Here is an example:
To target the visitors that have landed on your channel from Google web site:
- Attribute: Select Contextual-URL
- Operator: Select contains
- Value: Enter utm_source=google
Visitors on your channel web page, with browser URL that contains the text string you had specified, will see the personalized content you had selected. Visitors who do not have the specified text string in their browser URL will see the default content.
Tips and best practices
- You can create a segment by combining multiple contextual attributes. For example, you can create a segment to target visitors arriving on your channel from Facebook, between 6:00 PM to 11:00 PM every day.
Use the contextual segment in a rule
After you have created the inclusion and exclusion conditions using the contextual attributes, complete the following steps: