Personalization Engine Behavioral Personalization

By the end of this training module you will have used Terminalfour's Personalization Engine to personalize content on a webpage using behavioral based targeting methods such as personas, interests, and topics

Overview

Unlike the previous parts where we've defined rules about the visitor up front and content is shown based on where the user is coming from, the Personalization Engine goes far beyond that. You can target content based on user behaviors, what pages they've viewed, and what actions they've taken before visiting this page.

Persona, interest and topic all resolve from scored first-party cookies rather than the user's request. The switcher markup is identical to any other dimension; what differs is how the score gets set in the first place. This training assumes you've already built the content-type pattern in. Switching a component to a behavioral dimension is just a change to its Personalize by field.

How scoring works

Each dimension accumulates in a cookie as the visitor interacts with the site. Persona is single-value (one active persona at a time); interest and topic are multi-value, tracking the top-N scored codes at once (by default the top 3 are tracked, but you can change it higher if needed).

When several interests or topics are active, the first variant in the page that matches any of them is shown, not the one with the highest score, so order your variants by priority.

Setting the score

The score can be set in three different ways:

1. Trigger elements

By adding some additional markup to a button, link, or form dropdown, when a user interacts with that element it will count as a score for that type of dimension.

For example, if you add data-t4-trigger="persona" data-t4-value="UG" to a button or a link, whenever a user clicks, the engine auto-binds the event, writes the cookie, and re-renders.

Each interaction adds 3 to the score by default. To change this, add data-t4-weight, e.g. data-t4-weight="5".

The same pattern is used for interest and topic.

2. Page auto-tagging

A meta tag on a section's page layout silently builds the score as the visitor browses.

For example, if you add the following meta tag to all your undergraduate landing pages, every time a user visits the page their "Persona value" for "UG" (undergraduate) increases by 2. <meta name="t4-persona-value" content="UG:2">

The equivalent for interests and topics are t4-interest-value, and t4-topic-value.

3. Campaign links

You can add query parameters to your campaign URLs to ensure that anyone following those campaign links is given a score by the Personalization Engine.

Some examples:

  • ?set-p=UG:5 (persona)
  • ?set-i=AI:2,ML:1 (interest)
  • ?set-t=APPLYING:3 (topic)

These each write the score into the cookie on page load, so an email or ad click tags the visitor persistently, unlike the display-only ?persona= override used for QA. The same CODE[:WEIGHT] syntax is used as the auto-tag meta (weight defaults to 1, capped at 999).

The parameter names are deliberately terse, so a campaign URL doesn't advertise its purpose.

Thresholds and top-N

It wouldn't be ideal if simply visiting a page or following a link once set you as the wrong persona forever. For that reason you can use meta tags to set a confidence threshold so a single stray visit doesn't change the experience.

For personas you can use

<meta name="t4-persona-threshold" content="5">

For interests you can use

<meta name="t4-interest-threshold" content="5">

For topics you can use

<meta name="t4-topic-threshold" content="5">

Until a visitor's top score reaches the threshold, nothing is active for that dimension and the fallback is shown. Only the top score is checked, so once it's reached, the next highest interests or topics become active too. The default threshold is 0.

You can tune how many interests or topics are active at once with meta tags too e.g. t4-interest-topn / t4-topic-topn (the default is 3).

Page default persona

<meta name="t4-viewer-persona" content="UG"> sets the persona a page uses when the visitor doesn't yet have one that meets the threshold. It doesn't add to their score. For example, adding it to your undergraduate course pages means first-time visitors see the undergraduate content.

Cookie lifetime

By default, scores are stored in session cookies, which are cleared when the visitor closes their browser. To keep them longer, set an expiry in days on every page that sets a score: <meta name="t4-persona-expires" content="90">. t4-interest-expires and t4-topic-expires work the same way.

Consent

The engine only writes these cookies when the visitor's consent allows it. It checks for consent in this order: the IAB TCF framework, Google Consent Mode (personalization_storage), OneTrust (add <meta name="t4-consent-onetrust-group" content="…"> with your personalization cookie group), or a t4-consent-mode meta tag set to granted or denied. If it finds none of these, it assumes consent has been given. If your site requires opt-in consent, make sure one of these is in place. Geo and postal code personalization don't use cookies, so they aren't affected.

Standard codes

While the personas, interests, and topics are completely arbitrary and up to you to define, here are some examples to get you started:

Persona codes

Persona Meaning
UG Undergraduate
PG Postgraduate
SC Short course learner
ES Enrolled student
ST Staff member
PT Parent / supporter

Interest/topic codes

Interest/topic Meaning
OPENDAY Open day interest
APPLYING Application in progress
OFFER Offer holder
SCHOLAR Scholarship seeker
INTL International admissions
ACCOM Accommodation enquiry

Codes can be anything you like, as long as they only use letters, numbers, _ or -, are 32 characters or fewer, and match what's in data-codes. They aren't case-sensitive. Define your own where this set doesn't fit.


Building it in Terminalfour

We'll replace the personalization element on the Homepage Hero Banner, this time with a persona list. Personas are usually a small, fixed set, so a List works well here.

Navigate to Assets > Lists and create a list called "Personas", with an entry for each persona plus one for the fallback:

List Entry Name List Entry Value Selected
Undergraduate UG No
Postgraduate PG No
Short course learner SC No
Enrolled student ES No
Staff member ST No
Parent / supporter PT No
Everyone else DEFAULT No

Edit the Homepage Hero Banner content type, remove the Personalization Postal Code element, and add this element in its place:

Name Description Element Type Size
Personalization Persona Select which persona this variant should be shown to Select Box
[Personas]
80

Update the text/personalized-hero content layout so data-codes outputs the new element:

data-codes="{{selectedValues element="Personalization Persona"}}"

Finally, select "Persona" for the Personalize by field on your Personalized Hero content and choose a persona for each Hero Banner. Interests and topics follow the same steps, with their own lists.

For example, a "Topics" list:

List Entry Name List Entry Value Selected
Open day interest OPENDAY No
Application in progress APPLYING No
Offer holder OFFER No
Scholarship seeker SCHOLAR No
International admissions INTL No
Accommodation enquiry ACCOM No
Everyone else DEFAULT No

Testing your variants

To preview the page as a particular audience without changing your scores, add ?persona=UG, ?interest=OPENDAY or ?topic=APPLYING to the URL.