Difference between revisions of "AddEventBatch"

From Gvp-public
Jump to navigation Jump to search
Line 9: Line 9:
  
  
NOTE: Each event has the timestamp, event and data. The data parameter could be create with dynamic fields as needed. It's sent in a sequence of key:value.
+
NOTE: Each event in the array eventData has three members: timestamp, event and data. The data parameter could be create with dynamic fields as needed. It's composed by a sequence of key:value.
  
For example: If wants to send three groups of data and it has different name. The application should control the order to sent that.
+
For example: If wants to send three groups of data and it has different name. The application should control the order to sent that and can sent many events in each one.
  
 
* First batch:
 
* First batch:
 
: - Timstamp: { now }
 
: - Timstamp: { now }
: - Event: DetailsNavigation
+
: - Event: FirstBatch
: - Data: { object with information }
+
: - Data: [ Array of Event object with information ]
 +
 
 +
* Second batch
 +
: - Timstamp: { now }
 +
: - Event: SecondBatch
 +
: - Data: [ Array of Event object with information ]
 +
 
 +
* Third batch
 +
: - Timstamp: { now }
 +
: - Event: ThirdBatch
 +
: - Data: [ Array of Event object with information ]
 +
 
  
* Second batch<br>
 
: - Timstamp: { now }<br>
 
: - Event: RentProcess<br>
 
: - Data: { object with information }<br>
 
  
* Third batch<br>
 
: - Timstamp: { now }<br>
 
: - Event: WatchingXperience<br>
 
: - Data: { object with information }<br>
 
  
  
Line 40: Line 43:
 
|ParamType=[[AnalyticsEventItem]]
 
|ParamType=[[AnalyticsEventItem]]
 
|ParamRequired=required
 
|ParamRequired=required
|ParamDescription=The eventData parameter is an [[AnalyticsEvenItem]] object type and represent a set of data to register the event in the Mongo data base.
+
|ParamDescription=The eventData parameter is an [[AnalyticsEventItem]] object type and represent a set of data to register the event in the Mongo data base.
 
: e.g.  
 
: e.g.  
 
:: {
 
:: {
Line 47: Line 50:
 
:::  eventData: [
 
:::  eventData: [
 
::::  {
 
::::  {
::::  "Timestamp" : "4315435114",
+
:::::  "Timestamp" : "4315435114",
::::  "Event" : "Navigation",
+
:::::  "Event" : "Navigation",
::::  "Data" :
+
:::::  "Data" :
:::::    [
+
::::::    [
::::::    {"ChannelListed": "channel_name1", "ProductId": "123" },
+
:::::::    {"ChannelListed": "channel_name1", "ProductId": "123" },
::::::    {"PageViewed": "page_name1", "ProductId": "123" },
+
:::::::    {"PageViewed": "page_name1", "ProductId": "123" },
::::::    {"ButtonClicked": "button_name1", "ProductId": "123" },
+
:::::::    {"ButtonClicked": "button_name1", "ProductId": "123" },
::::::    {"ButtonClicked": "button_name2", "ProductId": "123" },
+
:::::::    {"ButtonClicked": "button_name2", "ProductId": "123" },
::::::    {"PageViewed": "page_name2", "ProductId": "456" }
+
:::::::    {"PageViewed": "page_name2", "ProductId": "456" }
:::::    ]
+
::::::    ]
 
::::  }
 
::::  }
 
:::  ]
 
:::  ]

Revision as of 15:03, 13 June 2014

Description

The AddEventBatch is a method to add massive events in just one request. The same behavior of AddEvent, the most common use is on mobile device (after stay offline during some time) or when the events can be send in a group of events. On mobile device in a offline mode, all events that wants to add can be storage in a pool and it become online, send all data in one request to the AddEventBatch.

The difference between AddEvent, is that the parameter eventData is an Array of AnalyticsEventItem that contains each event to add with his info like timestamp and event title.

The AddEventBatch can be used logged or anonymous.

For more information about the behavior, see AddEvent method.


NOTE: Each event in the array eventData has three members: timestamp, event and data. The data parameter could be create with dynamic fields as needed. It's composed by a sequence of key:value.

For example: If wants to send three groups of data and it has different name. The application should control the order to sent that and can sent many events in each one.

  • First batch:
- Timstamp: { now }
- Event: FirstBatch
- Data: [ Array of Event object with information ]
  • Second batch
- Timstamp: { now }
- Event: SecondBatch
- Data: [ Array of Event object with information ]
  • Third batch
- Timstamp: { now }
- Event: ThirdBatch
- Data: [ Array of Event object with information ]

Parameters

  • token (String, required)
A valid token for identifying the API session context. The token can be anonymous or logged.
The eventData parameter is an AnalyticsEventItem object type and represent a set of data to register the event in the Mongo data base.
e.g.
{
Token: "",
mediaInfo: "",
eventData: [
{
"Timestamp" : "4315435114",
"Event" : "Navigation",
"Data" :
[
{"ChannelListed": "channel_name1", "ProductId": "123" },
{"PageViewed": "page_name1", "ProductId": "123" },
{"ButtonClicked": "button_name1", "ProductId": "123" },
{"ButtonClicked": "button_name2", "ProductId": "123" },
{"PageViewed": "page_name2", "ProductId": "456" }
]
}
]
}
  • mediaInfo (String, optional)
This parameter can be found in the GetMediaURL and has all information about the Movie. Is passed, it will be used to assign the eventData with the movie.
e.g.
"MediaInfo": "eyJNb3ZpZUlkIjozNTkzNiwiTWVkaWFJZCI6 … XlsaXN0SWQiOjAsIk1lZGlhVHlwZSI6MSwiRHVyYXRpb24iOjU4MjB9"


Returns

Returns a JSON object containing the information if the event is registered on server.

Example:

{

"StatusCode": 0,
"Severity": 1,
"StatusMessage": "OK",
"Content": true

}


Exceptions

None


Caching

This method is not cached.


Known issues

None


Version history

API Version Number Change description Changes author
1.0 Initial method design Harley Cabral
2.4 Ricardo Calvo



See also