Content View
An event that describes the action of viewing content, such as a newspaper article, on a website.
Here's an example of a Content View:
- Javascript
- Swift
- Kotlin
- Java
- Objective-C
pcdp("event", "track", {
"clientId": "kevel",
"siteId": "kevel.com",
"type": "contentView",
"customFields": {
"debug": "true",
"role": "superuser"
},
"content": {
"id": "25545c",
"name": "Internet reaches 4bn users",
"categoriesList": [
"News",
"Internet"
],
"media": "article",
"access": "paid"
}
})
import VelocidiSDK
let trackingEvent = [
"clientId": "kevel",
"siteId": "kevel.com",
"type": "contentView",
"customFields": [
"debug": "true",
"role": "superuser"
],
"content": [
"id": "25545c",
"name": "Internet reaches 4bn users",
"categoriesList": [
"News",
"Internet"
],
"media": "article",
"access": "paid"
]
] as [String: Any]
VSDKVelocidi.sharedInstance().track(trackingEvent, userId: userId)
@import VelocidiSDK;
NSDictionary *trackingEvent = @{
@"clientId" : @"kevel",
@"siteId" : @"kevel.com",
@"type" : @"contentView",
@"customFields" : @{
@"debug" : @"true",
@"role" : @"superuser"
},
@"content" : @{
@"id" : @"25545c",
@"name" : @"Internet reaches 4bn users",
@"categoriesList" : @[
@"News",
@"Internet"
],
@"media" : @"article",
@"access" : @"paid"
}
};
[VSDKVelocidi.sharedInstance track: trackingEvent userId: userId]
import org.json.*
import com.velocidi.Velocidi
val trackingEvent = mapOf(
"clientId" to "kevel",
"siteId" to "kevel.com",
"type" to "contentView",
"customFields" to mapOf(
"debug" to "true",
"role" to "superuser"
),
"content" to mapOf(
"id" to "25545c",
"name" to "Internet reaches 4bn users",
"categoriesList" to arrayOf(
"News",
"Internet"
),
"media" to "article",
"access" to "paid"
)
)
Velocidi.getInstance().track(userId, JSONObject(trackingEvent))
import org.json.*;
import com.velocidi.Velocidi;
JSONObject trackingEvent = new JSONObject()
.put("clientId", "kevel")
.put("siteId", "kevel.com")
.put("type", "contentView")
.put("customFields", new JSONObject()
.put("debug", "true")
.put("role", "superuser")
)
.put("content", new JSONObject()
.put("id", "25545c")
.put("name", "Internet reaches 4bn users")
.put("categoriesList", new JSONArray()
.put("News")
.put("Internet")
)
.put("media", "article")
.put("access", "paid")
);
Velocidi.getInstance().track(userId, trackingEvent);
In more detail, the fields supported on every Content View are:
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
clientId | string | "kevel" | The client identifier. | ||
siteId | string | "kevel.com" | The client's site identifier. | ||
type | required | "contentView" | "contentView" | The event type. | |
customFields | object of string | {...} | An object with custom fields for extra metadata to be supplied in the event. The values within this object must all be strings. | ||
facebookConversionTracking | Facebook Conversion Tracking Details | {...} | A description of a tracking event to send to Facebook using Facebook Conversions API. | ||
content | required | Content | {...} | A description of the actual content being viewed. |
Facebook Conversion Tracking Details
A description of a tracking event to send to Facebook using Facebook Conversions API.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
pixel_id | string | "396622227884531" | The pixel ID to associate this Facebook tracking event with. | ||
event_id | string | "0c53d0b57" | ID used to deduplicate events sent by both Facebook Pixel and Conversions API. More information about the usefulness of this ID is available at https://developers.facebook.com/docs/marketing-api/server-side-api/using-the-api/deduplicate-pixel-and-server-side-events. | ||
event_name | string | "AddToCart" | A Facebook pixel Standard Event or Custom Event name. This field is used to deduplicate events sent by both Facebook Pixel and Conversions API. The available Standard Events are listed in https://developers.facebook.com/docs/facebook-pixel/reference#standard-events. | ||
custom_data | object | {...} | Parameters to send additional data Facebook can use for ads delivery optimization. More information about the fields that can be supplied here is available at https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data. |
Content
A description of the actual content being viewed.
Field | Required | Type | Default | Example | Description |
---|---|---|---|---|---|
id | string | "25545c" | The content identifier. | ||
name | string | "Internet reaches 4bn users" | The title of the content. | ||
categoriesList | array of string | ["News", "Internet"] | A hierarchically sorted list of the categories the content is inserted in. | ||
media | string | "article" | The type of media this content is made of. Typical values are 'video', 'article' and 'blog'. | ||
access | string | "paid" | The type of access associated with the content. Typical values are 'paid' and 'free'. |