Web personalization
Show each visitor content filled in from their own profile, on your website and apps.
Web personalization means the text or markup a visitor receives is filled in from what Optima knows about them at the moment the page loads: their first name, a loyalty balance, whether they have agreed to marketing. You switch it on per item with the Personalized checkbox in the Digital content editor, and write the personal parts as tokens in curly braces. Visitors Optima does not recognise get a neutral version.
On-site content that a campaign sends to a chosen audience (the web banner, web personalization and mobile in-app channels) uses the same language; it adds values the campaign fixed when it sent the content. Those are chosen in the campaign's message template, not here.
Who uses it
Campaign creators write the content; app developers check how it renders. Editing needs content_editor, or another role your administrator has given access to this area — see Licences and roles. It needs the content feature of the Digital package.
How it works
- The Personalized checkbox appears on items with Payload format Structured (JSON) or Unstructured (HTML/CSS/JS). When it is off, the item is served exactly as authored, with no template processing. A consent banner and a Recommended items item manage this themselves, so the checkbox is not shown for them.
- When it is on, the text values of the item are filled in on the server for each visitor. Only what the template prints ever reaches the visitor, never the profile itself. A visitor whose device is not yet known is rendered with an empty profile.
- Next to the field, the personalization button opens a helper that lists the profile attributes, consents, linked records and datasets available and inserts the token for you.
- The editor previews your work. For structured items, the text is checked when you save. For HTML items, Live preview renders the item against sample values from your schema; the real render happens when a visitor loads the page.
- The profile data comes from the tracking entity set on Tracking. Without one, the editor warns that personalization has nothing to read, with a link to Tracking → Settings.
What you can use in a template
On-site templates read the visitor's profile, and have no formatting helpers. The full list of tokens is in Personalization syntax, under on-site and in-app content. In short:
| Token | Meaning |
|---|---|
{{.Attributes.first_name}} | An attribute of the visitor's profile. |
{{if .Consents.marketing}}…{{end}} | Shows text only when the visitor granted the purpose. |
{{.Parents.household.size}} | An attribute of a linked parent profile. |
{{range .Children.order}}…{{end}} | Loops over linked child profiles. |
{{range .Datasets.loyalty}}{{.points}}{{end}} | Loops over linked custom dataset records. |
{{.Identifiers.email}} | One of the visitor's own identifiers, such as their email address. Use only where it is safe for the visitor to see it. |
{{if .Found}}…{{end}} | Shows text only for a visitor Optima has matched to a profile. |
Published content is visible to anyone who holds the public SDK key. Never put confidential or per-customer data in a payload that is not personalized, and keep personalized templates to what the visitor may see.
Examples
Greeting that falls back. In a banner payload text: {{if .Found}}Welcome back, {{.Attributes.first_name}}!{{else}}Welcome to Kupko{{end}}.
Offer only for people who agreed to marketing. {{if .Consents.marketing}}Your 10% code: SPRING{{end}}.
Common problems
- The token shows nothing. The visitor is unknown, the attribute is empty, or the tracking entity does not have that attribute. Wrap the text in a condition with a fallback.
- Saving fails with a template error. The tag is not closed or the name is wrong; the error names the line.
- Helpers like
defaultorupperare rejected. They are not available on-site. Useif,eqandandinstead.