HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

## Promote callback

Promote content is provided by Optimizely in the form of a JavaScript callback method. When the content is ready, it is passed to this callback function in the form of JSON data.

The `jsonData` parameter is an array with JSON data, where each item of the array contains a Promote creative with its properties.

(Script tags will be stripped)

Below is an example JSON array response.

## Promote function

You need to add a function inside the `PeeriusCallbacks` variable to render the content from the JSON array. An example of `smartContent` function added in the `PeeriusCallbacks` is shown below.

### Example explained

_smartcontent1_ and _smartcontent2_ are the position names. They are used to differentiate between content containers in the same page.

In this example, the content (with position names _smartcontent1_ and _smartcontent2_) is placed in different locations in the same page – _content1_ and _content2_ respectively. _content1_ and _content2_ are the IDs of the desired containers in the page, as shown in the example below.

Alternatively, you can use a class name instead of a container ID.

## Track clicks on Promote content

If the user clicks on an Optimizely Promote creative, the click must be tracked in order to generate useful recommendations and reports. So you must call `Peerius.smartContentClick(id)` when a creative is clicked, and the click takes the customer to a new page.

Usage of `smartContentClick(id)` is demonstrated in the example below.