To personalize content on the page,
- Enable personalization on your site or a section of your site by setting up the cq:contextHubPath and cq:contextHubSegmentsPath properties.
- Create some audience segments. See examples below for examples of the types of attributes that can be used to build your audience segments.
- Change to Targeting mode in the toolbar (next to Peview)
- Create a new Activity and click Start Targeting
- Add experiences targeted to specific audience segments and customize component content.
- Use preview mode to simulate different audience segments
Things to be aware of:
- The loading of each targeted component on a page can be delayed by up to a few seconds while the audience segment data is loaded. This delay is not just on the first page load.
- Personalization must be enabled on pages with targeted content, but also on pages that contribute to audience segments, like tagged pages or pages you want to contribute to calculate numbers of pageviews or whether a visitor is new or returning.
- Every domain (___.buffalo.edu) is counted as a different site for persistent personalization data. For example, a site at www.buffalo.edu/site.html cannot tell whether a page was loaded on engineering.buffalo.edu/page.html (Limited workarounds may be possible via custom GTM tags.)
- A visitor will also reset or have a separate store of persistent data for each browser or device, each incognito/private browser session, or when they clear their browser's local storage.
- Site visitors generally have no interface for adjusting their persistent personalization data, other than possibly clearing it via clearing their browser's cache/cookies/localstorage.
- On shared computers that do not enforce a full user profile reset between users, persistent personalization data will be shared among many users.
The pageviews contexthub store tracks prior pageviews (on pages within the same domain with personalization enabled). The number of views of any tags are tracked, as well as the number of any pages each day. Use this to target content such as:
- distinguish first time visitors from returning visitors (pageviews/isReturning; calculated based on whether or not all pageviews were today)
- guess interests based on past pages visited via the tags on thoe pages (pageviews/tags/tag:path:name...)
- target content to highly engaged visitors (pageviews/week, pageviews/month)
The geolocation contexthub store contains information about the user's location, such as latitude, longitude, continent, country, state, etc. Use this information to:
- hint at page translations or other language assistance (geolocation/address/countryCode)
- market programs for users in specific parts of the world (geolocation/continent, geolocation/address/countryCode)
- guess at whether a user is from our area or not (geolocation/address/county, geolocation/address/regionCode)
- guess at a user's network bandwidth capacity (geolocation/bandwidth)
- guess at a user's timezone (geolocation/timezone)
Note: The location is guessed based on the user's network connection (IP address) information. This cannot be blocked by the user, does not pop up a request for permissions from the user, and is available for all devices. However, it is sometimes completely inaccurate.
The campaign contexthub store contains information about any campaing information in the URL that brought the user to this site or page. Information is stored from the last utm_... URL parameters. UTM campaign parameters are a replacement for passive referrer tracking, which is generally being phased out due to privacy and security concerns. Use this information to:
- personalize pages based on social, search or other purchased advertisements
- target content based on custom links you add in email, social or other sources
The custom-events contexthub store is a place to store and use custom keys and values. Use this information to:
- target content based on these custom events
You can also create segments based on:
- date and time of day (surferinfo/hour, surferinfo/month, etc.)
- browser and device characteristics (surferinfo/browser/family, surferinfo/device/category, surferinfo/os, surferinfo/window/dimension/width, etc.)
- boolean logic
- other segments
You can set values with ContextHub.setItem('store/key', 'value'). Values will be persisted across all page loads in the domain. The store named "custom-events" is the best place for custom keys/values (e.g. ContextHub.setItem('custom-events/your-app/some-key', 'some-value').
If including a script on a lot of pages, such as via Google Tag Manager, your code should check whether the ContextHub object is actually loaded, such as writing code like if (window['ContextHub']) ContextHub.setItem(...).