Using "Experiences"

Use Experiences with server-side personalization

Experiences let you control content across multiple channels such as web, email, and mobile app.

There are two ways to use experiences with your mobile apps:

  1. Use your own logic to determine which Slots to use in which parts of your app. If you’re doing this, then the best approach is to use an Is on experience X rule within the slot rules for each slot used by your mobile app.

    For example, you might use a rule Is on experience: VIP to select a recommendation block based on previous purchases, and another rule Is on experience: New Customer to select recommendations based on trending products.
  2. Using the Experiences API, you can use the configuration of your web pages in Site Editor to control which content appears in your app. This is a good approach if you have web pages which correspond directly onto pages in your app. Your app can get a list of the slots which should appear on a specific page, and then request the content. You still need to use logic in your app to determine where in the app page the content is incorporated.

Calling the Experiences API

To use the Get Campaigns call to retrieve a list of slots used on a page.

You need to replace:

Your content serving domain with the correct domain. To find this, expand the User menu, then go to Settings > System configuration > Custom domains and copy the domain from the Content Serving URL e.g. c8.dycdn.net

Your account id with your account id. To get your account id from Fresh Relevance, expand the Settings menu and copy the Account ID e.g.

Device id with the device ID for the site visitor, from the tracking cookies.

Current URL with the full URL for the page the personalization content is served on; note you must URL encode this

Example

https://c8.dycdn.net/abcdefg1/campaigns/?k=z321xx4d&d=ptfbxnnebe&url=https%3A%2F%2Fwww.mysite.com%2F&vat=inc&landing-page-category=undefined&is_logged_in=false&curr=GBP

Returned data

[
    {
        "_id": "5ef5e08646606491920ba7d1",
        "contentconfig": "1726070796203",
        "priority": 2,
        "takeover": false,
        "name": "Default Experience",
        "dt": "2020-06-26T11:48:22.545Z",
        "archive_dt": "",
        "slug": "joj3uai",
        "archive": false,
        "activity_in_last_24": "2024-10-04T09:08:44.108Z",
        "users": 105,
        "views": 394,
        "content_config_id": "66e1c00ce8b91d44c0185c15"
    }
]

Retrieving details about each slot used on a page

If you need details of how each experience is placed, then then using the returned date from the Get Campaigns call, you can call the Get Experience call for each of the experiences:

https://Your activity domain/e/?w=Your account id&id=Experiences slot id

You need to replace:

Your activity domain with the correct domain. To find this, expand the User menu, then go to Settings > System configuration > Custom domains and copy the domain from the Activity Domain e.g. am.dycdn.net

Your account id with your account id. To get your account id from Fresh Relevance, expand the Settings menu and copy the Account ID e.g.

Experiences slot id with the unique id returned in the _id field from the Experiences API call.

The data returned will be like this:

{
  "rules": {
    "welcome - morning": [
      {
        "target": {
          "selector": "#extSvcs"
        },
        "ruleid": "tfd3s1",
        "dynamic": true,
        "pageSpec": {
          "location": [
            {
              "hostname": "www.mysitename.com",
              "pathname": "/"
            }
          ]
        },
        "position": "append"
      }
    ]
  },
  "k": "xxkeyxx"
}