Event type: Monetization
Monetization events are related to user actions in relation to offers. This includes events when the user do their initial purchase as well as when the subscription is renewed, renewal fails, removed etc.
The available events are:
- Purchased
- Subscription Renewed
- Subscription Renewal Failed
- Subscription Upgraded
- Subscription Canceled
- Subscription Undo Canceled
- Subscription Removed
Purchased
Trigger:
When a user goes through the purchase flow and successfully purchase something, it will trigger an event with type monetization.purchased
. This event will be triggered independent on if the user starts a subscription or rent a movie, or if the user starts a trial, uses a promotion for 100% or are actually paying.
Type:
monetization.purchased
Payload
{
"type": "monetization.purchased",
"timestamp": "2024-04-15T12:48:16.557Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "XXXXXXXXXXXXXXXXXXXXXXXXXOFR",
"promoCode": "BOYSSXQWH",
"price": {
"currency": "USD",
"netPriceCents": 657,
"grossPriceCents": 900
},
"trialDurationSeconds": 259200
}
}
Subscription Renewed
Trigger:
An event of type monetization.subscription.renewed
is triggered when a subscription is renewed. This happens both when a user goes from free trial into having an active subscription and when the subscription is renewed according to it's periodicity (monthly or yearly). A renewed event is triggered independent on if the user have 100% discount or if money is withdrawn from the users payment method.
Type:
monetization.subscription.renewed
Payload
{
"type": "monetization.subscription.renewed",
"timestamp": "2024-04-17T05:39:51.616Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "XXXXXXXXXXXXXXXXXXXXXXXXXOFR"
}
}
Subscription Renewal Failed
Trigger:
Sometimes a renewal fails for users, this will trigger an event of type monetization.subscription.renewal_failed
. This happens when money can not be withdrawn from the users account. Depending on the retry strategy, this event may be triggered multiple times with a certain amount of days in between before the users subscription is downgraded.
Type:
monetization.subscription.renewal_failed
Payload
{
"type": "monetization.subscription.renewal_failed",
"timestamp": "2024-04-17T05:39:51.616Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "XXXXXXXXXXXXXXXXXXXXXXXXXOFR",
"attempt": 1
}
}
Subscription Upgraded
Trigger:
A user can upgrade their subscription to a more expensive Offer. They can e.g. upgrade from a Monthly to a Yearly subscription, or from Basic to Premium. When this happens, an event of type monetization.subscription.upgraded
will be triggered.
Type:
monetization.subscription.upgraded
Payload
{
"type": "monetization.subscription.upgraded",
"timestamp": "2024-04-15T12:49:18.314Z",
"data": {
"originalOfferId": "XXXXXXXXXXXXXXXXXXXXXXXXXOFR",
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "YYYYYYYYYYYYYYYYYYYYYYYYYOFR",
"price": {
"currency": "EUR",
"netPriceCents": 1000,
"grossPriceCents": 1000
}
}
}
Subscription Canceled
Trigger:
If a user decides to cancel their subscription, an event of type monetization.subscription.canceled
will be triggered. This events only signal that the subscription have canceled the subscription but they will keep Entitlement to the Offer until the billing period ends.
Type:
monetization.subscription.canceled
Payload
{
"type": "monetization.subscription.canceled",
"timestamp": "2024-04-15T12:52:44.511872093Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "YYYYYYYYYYYYYYYYYYYYYYYYYOFR"
}
}
Subscription Undo Canceled
Trigger:
If a user undo the cancelation of their subscription, it means that the billing and renewal process will continue as it was before the cancelation. When the user undo the cancelation, it will trigger an event of type monetization.subscription.undo_canceled
.
Type:
monetization.subscription.undo_canceled
Payload
{
"type": "monetization.subscription.undo_canceled",
"timestamp": "2024-04-18T08:12:58.063460256Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "YYYYYYYYYYYYYYYYYYYYYYYYYOFR"
}
}
Subscription Removed
Trigger:
When a subscription is removed from a user and they loose the Entitlement to that Offer, an event of type monetization.subscription.removed
is triggered. There's different underlying reasons for why a subscription is removed. The property reason
in the payload will indicate which reason triggered that specific event.
Available reasons for subscription removed:
- SoftCancel - When a user have canceled their subscription and the subscription is removed when the billing period ends.
- DunningDowngrade - When all renewal attempts fails for a user and the subscription is downgraded.
- SubscriptionUpgrade - When a subscription is upgraded, then a
removed
event is triggered with offer ID for the Offer that the user upgraded from. - HardCancel - When a subscription is removed before the billing period ends. Can be done through the Magine Pro Console.
Type:
monetization.subscription.removed
Payload
{
"type": "monetization.subscription.removed",
"timestamp": "2024-04-15T12:49:20.019457004Z",
"data": {
"userId": "XXXXXXXXXXXXXXXXXXXXXXXXXUSR",
"offerId": "XXXXXXXXXXXXXXXXXXXXXXXXXOFR",
"reason": "SubscriptionUpgrade"
}
}
Parameters
In the various events, the included parameters inside the data object will vary between the different events and what was actually added or changed in the user object. These are the parameters that can be included:
Field | Type | Description |
---|---|---|
userId | string | ID of the user. |
offerId | string | ID of the offer. |
promoCode | string | Promocode that was used during the purchase. |
price | object | Object that will contain all properties related to the price and what the user have paid. |
price.currency | string | Currency of the offer. |
price.netPriceCents | integer | Net price in the sub-currency of the offer. E.g. If the net price is 3.99 EUR, then netPriceCents would be 399. |
price.grossPriceCents | integer | Price of the offer before any discounts have been applied. Gross price is also in the sub-currency. |
trialDurationSeconds | integer | The length in seconds of the free trial the user will have. Only included in the purchased event. |
attempt | integer | Indicates which attempt in the retry strategy that triggered this event i.e. first, second etc. Only included for subscription.renewal_failed. |
originalOfferId | string | In the subscription.upgraded event the property originalOfferId is included. This is the offer that the user had before they did the upgrade of their subscription. |
reason | string | The underlying reason of why a subscription have been removed from a user. Only included in the subscription.removed event. |
Updated 9 months ago