Playvite Events
You can call in-game event API to send events about user progres to OL. Based on these events, we update user progress and reward ambassadors when the user achieved the milestone defined in the campaign.
Playvite Campaign
A campaign is determined by the following:
- Display Name - The display name of your Playvite campaign.
- Game Association - The game this campaign is for
- Quest - The display name of your Quest
- Metrics Milestone - The metric to measure for this campaign.
- type (milestoneType)
- value (milestoneValue)
- Start Date - Start date and time of this campaign, in UTC
- End Date - End date and time of this campaign, in UTC
- Total Budget - This is a dollar amount that sets the maximum amount of money that can be paid out via commission for this campaign.
- Commission Cap - This is a dollar amount that sets the maximum amount of money that can be paid out via commission for this campaign to a single ambassador.
- Commission by Country - Commission per country. Only users in these countries' lists will be able to qualify.
- Operating System - Which operating system this campaign is for. Only users from that operating system will qualify:
- Windows
- Mac
- Android
- iOS
API
POST /app/v1/ingame/events
REQUEST BODY
{
"type": "metric_milestone",
"value": {
"id": "6b6d6a24-c5bd-4468-9f80-49dbd0d13709",
"os": "windows",
"milestoneType": "user_rank",
"milestoneValue": 20,
"userId": "9e8afbfb-332c-4a9c-bfb7-180234d1dcf0",
"firstLoginDate": "2024-06-13T21:08:48.576Z"
}
}
- type: The type of event. To send playvite events, type should be metric_milestone
- value: Value of the event.
- id: id is optional and uniquely identifies the event.
- os: The os user is playing a game on. Only users whose os match with os defined in the campaign will be able to qualify.
- milestoneType: This is the unique string that identifies the milestone we are tracking. Examples: user_rank, kill_enemies, etc. Every campaign has a unique milestoneType.
- milestoneValue: This is the user current progress of that milestone. This value should be a positive integer.
- userId: The Open Loot userId of the user.
- firstLoginDate: This is the date when the user signed up to the game.
How do we process these events?
- We get the playvite campaign based on milestoneType we received in the event.
- We get the ambassador associated with the user.
- We update the user progress based on milestoneValue we received.
- We discard events if any of the below validation failed.
- Event os does not match with campaign os.
- User OL account created date is not within 60 days before the campaign start date. So account signup date should be >= campaign start date - 60 days
- User is not associated with any ambassador or ambassador does not have playvite acccess or User country is not validated (when user link with ambassador, we verify their country).
- User country is not defined in the country list of the campaign.
- Campaign is not active or not started or has been ended.
- Campaign budget or ambassador commision cap is completed.
- User completed the milestone before campaign started. We check that by the received milestone value is greater than campaign required milestone value and user does not have any in-progress acitivity.