Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Server-side campaigns gives you control over building and deploying more complex messages. While the Evergage Platform handles the campaign logic, a developer is required to write the code to call the appropriate APIs and provide Evergage with the necessary information about the user.

It works like this: Your servers call the Evergage server-side campaign API, providing information about the visitor (typically user ID). With that information, Evergage handles the campaign logic and returns recommendations and other campaign data (in JSON format) that applies to that visitor. Your server is responsible for handling the JSON and building the message to show the visitor, as well as calling the appropriate action tracking APIs to track campaign impressions and clicks.

This Article Explains

This article details how to create a server-side campaign.

Sections in this Article

Using Evergage's UI to Create a Server-Side Campaign

Create a Server-Side Campaign

Server-side messages are created at the Campaign level in the Evergage platform.

  1. Log into the Evergage platform
  2. In the Channels & Campaigns section, hover over Web, then select Server-Side Campaigns 
  3. Click New Campaign

Create a Server-Side Campaign Message

  1. Enter a Target
  2. Click Add New to insert a new row 
  3. Define a key, value pair under the Name  and Value   column.
  4. A value can be returned as quoted text by selecting Text as Type, or Number to be formatted as an unquoted number. See below on how to configure Promoted Content
  5. Insert dynamic content queries in the Value column by clicking a value in the grid, then selecting an option from the Dynamic+ dropdown. 
  6. Dynamic Message Content is not supported in Name, only as values.
  7. Click the Copy To All to copy all values in the row to all experiences in the campaign.
  8. Select Delete will remove that row from all experiences.

Configure Promoted Content

  1. Configure Promoted Items in Message Settings if the message contains any Promoted Content types.

  2. Name can be anything, Value should be $items and Type Promoted Content to return all applicable items in a JSON array.

“Name” can be anything, “Value” should be $items and “Type” Promoted Content to return items in JSON format


  • Can return ADMC in text or number format (configured by “Type”). Provide default value (I don’t remember the syntax to give an example) or the message will fail to render if no values are found


  • Dynamic Message Content not supported in “Name”, only as values

  • Insert Dynamic Message Content with dropdown by clicking in a Value, then selecting an option from the dropdown

Preview the Message

You can preview the rendered JSON message:

  1. Click Preview
  2. Under Experience, choose an experience to preview
  3. Select a Test User to view JSON that would return for the user
  4. The message will be under the "dataMap" key

Using Evergage UI to Setup A/B Tests, Targeting, and Recommended Content

Set up A/B Tests or Rule-Based Targeting

Click on the orange SETUP button and Experiences to access this interface. Here you can:

  1. Clone the Experience you made
  2. Set up A/B tests and control percentages
  3. Target experiences based on rules

Control the whole Campaigns Targeting Rules and Goals

Click on the orange SETUP button and Campaign Settings to access this interface. Here you can:

  1. Setup the Goals for this particular campaign (Remember all campaigns are auto-attributed against your Global Goals)
  2. Target all experiences in the campaign to particular segments
  3. Schedule the Campaign

Control the Campaign Schedule

It is easy to control the campaign schedule through this UI. 

Calling Evergage's Server-Side Campaign Endpoint


Server-side campaign event HTTP requests should use the path of your account-specific sscreceiver endpoint, which is:


  • See table below for more information on request parameters

  • Refer to   Send Events Server-side Using HTTP Requests  for more information sending HTTP requests and required parameters

  • (Optional) Include segment IDs in the segment membership (".sm") parameter to return segment memberships for the user in the response. Including only the segment membership parameter without the specific segment IDs will return all IDs of segments the user is a member of.

  • Most parameters are optional, but as much information about the user and user behavior should be sent along the campaign request

Example request for a named user

{"campaignResponses":[{"campaignId":"VtARR","campaignName":"Clone of Standard Home Hero","campaignType":"ServerSide","experienceId":"QAoO8","experienceName":"A","state":"Published","displayMode":"Personalize","saveParameters":false,"hidePageBeforeRedirect":false,"userGroup":"Control","serverSideMessages":[{"type":"evg_md","id":"CKV5V","targetName":"Home Hero","containsDynamicContent":true,"promotedItemKeys":[{"type":"p","_id":"bgw0021"},{"type":"p","_id":"hdb006"},{"type":"p","_id":"hbm005"}],"campaignState":"Published","dataMap":{"imageUrl":"","recommendedItems":[{"type":"p","created":1484080519670,"updated":1531756002246,"attributesUpdated":1530641306981,"name":"Michonne Evening Bag","description":"Satin. Silver hardware. Inside open pocket. Magnetic closure with foldover flap, fabric lining. 10\" x 2.5\" x 4\". Domestic.","url":"","imageUrl":"","dailyStats":[{"date":1531699200000}],"pregeneratedItemTemplateMetadata":[{"id":"3Bs1j","generationTime":1530641567386,"attributesUpdated":1530641306981},{"id":"6VBQe","generationTime":1530641567594,"attributesUpdated":1530641306981},{"id":"ArXvl","generationTime":1530641567735,"attributesUpdated":1530641306981},{"id":"ChSNu","generationTime":1530641567959,"attributesUpdated":1530641306981},{"id":"GcR6h","generationTime":1530641568162,"attributesUpdated":1530641306981},{"id":"UsRXI","generationTime":1530641568264,"attributesUpdated":1530641306981},{"id":"emrS3","generationTime":1530641568524,"attributesUpdated":1530641306981}],"categories":[{"type":"c","_id":"Women|Handbags"}],"relationships":[{"itemRelationshipKey":{"linkedItemId":"hbm003 ","itemRelationshipType":"Static","itemType":"Product","relationshipName":"Accessories"}}],"price":450.0,"currency":"USD","inventoryCount":1,"pregeneratedItemTemplateIds":["3Bs1j","6VBQe","ArXvl","ChSNu","GcR6h","UsRXI","emrS3"],"locked":false,"_id":"bgw0021","dimensions":{"Brand":["Prada"],"ItemClass":["Bags & Luggage"],"Gender":["Female"]},"tags":[{"type":"t","tagType":"Brand","_id":"Prada"},{"type":"t","tagType":"ItemClass","_id":"Bags & Luggage"},{"type":"t","tagType":"Gender","_id":"Female"}]},{"type":"p","created":1484080534670,"updated":1531756732612,"attributesUpdated":1517406765062,"name":"Shay Printed Pillow","description":"20\" x 20\". Printed polyester. Hidden zipper closure. Interior pillow included. 100% polyester fill. Spot clean. Imported.","url":"","imageUrl":"","validated":1511383617659,"pregeneratedItemTemplateMetadata":[{"id":"3Bs1j","generationTime":1517355048944,"attributesUpdated":1517354911274},{"id":"6VBQe","generationTime":1517355049085,"attributesUpdated":1517354911274},{"id":"ArXvl","generationTime":1517355049198,"attributesUpdated":1517354911274},{"id":"ChSNu","generationTime":1517355049354,"attributesUpdated":1517354911274},{"id":"GcR6h","generationTime":1517355049489,"attributesUpdated":1517354911274},{"id":"UsRXI","generationTime":1517355049592,"attributesUpdated":1517354911274},{"id":"emrS3","generationTime":1517355049745,"attributesUpdated":1517354911274}],"categories":[{"type":"c","_id":"Home & Decor|Bed & Bath"}],"price":210.0,"currency":"USD","pregeneratedItemTemplateIds":["3Bs1j","6VBQe","ArXvl","ChSNu","GcR6h","UsRXI","emrS3"],"locked":true,"_id":"hdb006"},{"type":"p","created":1484080580663,"updated":1531756646427,"attributesUpdated":1517406765062,"name":"Falling by I Am Not Lefthanded","description":"Falling by  I Am Not Lefthanded. Album: Yes Means No. Running time 3:16. Downloadable as mp3.","url":"","imageUrl":"","validated":1511383626384,"pregeneratedItemTemplateMetadata":[{"id":"3Bs1j","generationTime":1505789097526,"attributesUpdated":1505788787184},{"id":"6VBQe","generationTime":1484081407585,"attributesUpdated":1484080997954},{"id":"ArXvl","generationTime":1505766052522,"attributesUpdated":1505765938639},{"id":"ChSNu","generationTime":1484081408004,"attributesUpdated":1484080997954},{"id":"GcR6h","generationTime":1484081408164,"attributesUpdated":1484080997954},{"id":"UsRXI","generationTime":1484081408322,"attributesUpdated":1484080997954},{"id":"emrS3","generationTime":1484081408528,"attributesUpdated":1484080997954}],"categories":[{"type":"c","_id":"Home & Decor|Books & Music"}],"price":2.0,"currency":"USD","isProduct":true,"skuMap":[{"id":"558"}],"skuIds":["558"],"pregeneratedItemTemplateIds":["3Bs1j","6VBQe","ArXvl","ChSNu","GcR6h","UsRXI","emrS3"],"locked":true,"_id":"hbm005"}],"testGroup":"A","url":""}}],"campaignCreated":1531756833995,"priority":0,"id":"VtARR"}],"errorCode":0}

Request Parameters






Evergage account ID

Identifier of your account in Evergage (same as your subdomain


Evergage dataset ID

Identifier of your dataset in Evergage


Event time


Event timestamp in epoch milliseconds. Optional–if omitted, current time is used.


ID of the user

ID of the named user to associate with this event


ID of an anonymous user

ID of the anonymous user to associate with this event. Either this or userId is required.


Is anon event

Set this to true to indicate that the event is from an anonymous user


Company/account of user


For datasets tracking accounts, this identifies which account the user belongs to. If omitted, user's existing account association will be used.


Action name

Name of the action that the user just took.


Custom attribute


Specify any additional custom attributes for the user or account that you wish to set.



Url of the page the user is currently viewing


Referrer Url


The third-party referring URL that directed the user to this page, if any



The client's IP address


Page view


Presence of this indicates the event represents a page view


Segment Membership


Return segment memberships for the user in the response. Including only the segment membership parameter without the specific segment IDs will return all IDs of segments the user is a member of.


Required for item actions and if campaign requires an anchor item

The item JSON (see below for an example) of the item the user is viewing/purchasing/performing an action on. Required to qualify the user for campaigns configured with recommendations that requires an anchor item (co-browse, similar items, co-buy, etc)

Handle the campaign JSON

Calling the /sscreceiver endpoint will return any applicable server-side campaigns the user qualifies for in JSON format.

Be sure to check if the user is in the control group and not display the campaign for those users.  Users in the control group for a campaign if the “userGroup” value is “Control”, otherwise the value would be “Default”.

The JSON response will also include some metadata on the user in addition to campaign data. If the segment membership (".sm") parameter is present in the request, the response will include a “segmentMemberships” key that contains the segment IDs of the segment the user is a member of (see table above for more info)

Example of an item json for a Product, denoted by “‘type’: ‘p’”:

{"_id":"Pms003","categories":[{"_id":"Men|Shirts","type":"c"}],"currency":"USD","d":"Button-front. Imported. Available in checkered Blue. Cotton. Machine wash.","isProduct":true,"name":"Carroll Check Dress Shirt","price":160,"skus":{"816":{"a":[],"id":"816"}},"tags":[{"_id":"Shirts","type":"t","tagType":"ItemClass","name":"Shirts"},{"_id":"Male","type":"t","tagType":"Gender","name":"Male"},{"_id":"new","type":"t","tagType":"Badge","name":"new"}],"type":"p","url":"","imageUrl":""}

Tracking Campaign Impressions and Sending them to Evergage

In order for Evergage to provide campaign statistics and effectively manager Server-Side campaigns, you must track and return to Evergage the campaign impressions, clicks. and other relevant events. 

This section describes how to call the appropriate action tracking APIs to track campaign impressions and clicks.

  • To track a campaign impression, you should POST to Endpoint: /msreceiver
  • Track an impression on the campaign

    • Must also track an impression on the campaign if the user is in the control group. Don’t track click and dismissal events for the campaign if the user is in the control group

    • If the campaign contain recs, track that the user viewed the items. See details on “piks” below

  • Track user's clicks

    • If a user clicks on the campaign or an item on the campaign, track a click event

  • Track a dismissal if the user dismisses the rendered campaign without performing any action

Required Parameters





Evergage account ID

Identifier of your account in Evergage (same as your subdomain


Evergage dataset ID

Identifier of your dataset in Evergage

userId or .anonId

ID of the user to associate with this event. Set userId for a named user or .anonId for an anonymous user. Also set _anon=true if the event is from an anonymous user



This parameter is a JSON array containing a list of campaign metadata representing a message, or experience campaign action. See below for how to structure the payload

.cStat parameters

  • For each campaign, track an impression on the Experience and each message in the experience that the user saw. The .cStat would contain one impression on the experience of a campaign and one impression for each message in the experience, and may have multiple experiences or campaign stat events if more than one campaigns are displayed on the page. You do not have to specify the campaign ID

  • type

    • Expected values: “e” (experience) or “m” (message)

    • .cStat may only contain one object with type “e”

  • id

    • Id of the experience if type is “e”, or of the message if type is “m”

  • eid

    • The experience Id. Only required for tracking message stats - if the type is“m”

  • stat

    • Expected values: “i” (Impression), “c” (click), or “d” (Dismissal)

  • ug

    • User group

    • Only required if the user is in the control group. Set userGroup to “Control”, otherwise omit this parameter

  • href

    • Only required if campaign action is a click event (type=”c”)

  • piks

    • JSON array of Promoted Item keys - only populated for message stats - “type”: “m”.

    • Promoted Item Key object:

    • _id

      • id of the item

    • type

      • type of the item

      • Single character, such as “p” for “Product” or

      • Refer to “promotedItemKeys” in the campaign response for the correct type

  • Example of an impression on two campaign experiences:

    • .cStat=[{"type":"e","id":"ZcupW","stat":"i"},{"type":"m","id":"XrQUC","stat":"i","eid":"ZcupW"},{"type":"e","id":"AvBdc","stat":"i"},{"type":"m","id":"agdGd","stat":"i","eid":"AvBdc"}]]

  • Example of .cStat unencoded value in a request to track impression on a campaign with promoted items

    • .cStat=[{"type":"e","id":"ZcupW","stat":"i"},{"type":"m","id":"XrQUC","stat":"i","eid":"ZcupW", “piks”: [{"type":"p","_id":"bgw0021"},{"type":"p","_id":"hbm005"}]}]

Campaign Statistics and Analytics in Evergage

Detailed Event Analysis

Detailed events sent to Evergage can be studied to troubleshoot

Access this by clicking on the event stream

Summary Campaign Statistics

Summary Campaign statistics are available in the campaign overview screen

Detailed Campaign Statistics and Analysis

Detailed Campaign statistics are available by clicking on any campaign in the overview screen.

  • See Lift over Control for all Global Goals and Campaign Specific Goals
  • Confidence using Bayesian statistics
  • Analyze by click vs view attribution. 
  • Analyze impact for different segments. 
  • Change the attribution window
  • Look at different time periods

Catalog Stats are also updated 

Examples of Server-Side Campaigns

Experience A Setup

With an ALS Recipe

Example of what JSON will return for user f003822a2b46882e, shown in Preview and by calling test URL below:

Experience B Setup

With a static promoted content for an Avery Oxford Shirt

Example of what JSON will return for user f003822a2b46882e, shown in Preview and by calling test URL below

Notice different results for keys “imageUrl” and “recommendedItems” because Promoted Content is different for experience A and B.

For experience A“recommendedItems” is populated with items determined by configured the recipe

The JSON returned by the test urls above is the same JSON in the Preview

  • No labels