This page applies to Apigeeand Apigee hybrid.
View Apigee Edge
documentation.
Apigee uses the monetization variables for rating, calculating revenue share, and analytics. If you want your Apigee analytics to show the monetization information. By using the monetization variables, you can enhance the monetization capabilities of your transactions.
Monetization variables
The monetization variable names are predefined, and you can't create, edit, or delete the variables. You can assign either request or response variables to the monetization variables.
This table describes the monetization variables available in Apigee:
- If the
transactionSuccessvariable istrue. - If the
transactionSuccessvariable isNULLand themessage.status.codeis2xx(success).
Specifies the revenue of the transaction for calculating the developer's share. Apigee calculates the developer's share only if you have enabled revenue sharing in your rate plan.
- If the variable is set to
true, the transaction is monetized. - If the variable is set to
false, the transaction is not monetized.
If you don't specify this variable, the transactions are monetization based on the
value of the HTTP status code available in the message.status.code
variable.
If the HTTP status code of the response is NULL or >=300, a
transaction is not monetized; for all other status codes, the transaction is monetized.
Value assignment examples
The following examples show how to assign values to the monetization variables:
currency
The following example assigns the value of the booking[0].currency
JSON element
in the response to the currency
variable:
< Capture > < Collect > < Source>response < / Source > < JSONPayload > < JSONPath>booking [ 0 ] . currency < / JSONPath > < / JSONPayload > < / Collect > < DataCollector scope = "monetization" > currency < / DataCollector > < / Capture >
perUnitPriceMultiplier
The following example assigns the value of the booking[0].factor
JSON element in the response to the perUnitPriceMultiplier
variable:
< Capture > < Collect > < Source>response < / Source > < JSONPayload > < JSONPath>booking [ 0 ] . factor < / JSONPath > < / JSONPayload > < / Collect > < DataCollector scope = "monetization" > perUnitPriceMultiplier < / DataCollector > < / Capture >
revShareGrossPrice
The following example assigns the value of the minPrice
variable in the response header to the revShareGrossPrice
variable:
< Capture > <Collect> <Source>response</Source> <Header name="minPrice"> <Pattern ignoreCase="true"> { $ } < /Pattern > </Header> </Collect> <DataCollector scope="monetization">revShareGrossPrice</DataCollector> < /Capture >
transactionSuccess
The following example assigns the value of the bookingStatus
variable in the response header to the transactionSuccess
variable:
< Capture > <Collect> <Source>response</Source> <Header name="bookingStatus"> <Pattern ignoreCase="true"> { $ } < /Pattern > </Header> </Collect> <DataCollector scope="monetization">transactionSuccess</DataCollector> < /Capture >

