Apigee utilizza le variabili di monetizzazione per la valutazione, il calcolo della quota di entrate e l'analisi. Se
vuoi che le analisi Apigee mostrino le informazioni sulla monetizzazione. Utilizzando le variabili di monetizzazione, puoi migliorare le funzionalità di monetizzazione delle tue transazioni.
Variabili di monetizzazione
I nomi delle variabili di monetizzazione sono predefiniti e non puoi creare, modificare
o eliminare le variabili. Puoi assegnare variabili di richiesta o di risposta alle
variabili di monetizzazione.
Questa tabella descrive le variabili di monetizzazione disponibili in Apigee:
Variabile di monetizzazione
Tipo di dati
Descrizione
currency
Stringa
Specifica la valuta per il calcolo delle entrate derivanti da una transazione.
perUnitPriceMultiplier
Numero in virgola mobile
Specifica il fattore (moltiplicatore) per cui viene moltiplicato il costo per transazione.
Il costo per transazione è specificato nei prezzi delle
commissioni basate sul consumo del piano tariffario.
La moltiplicazione viene eseguita per una transazione solo se la transazione è
monetizzabile. Una transazione è monetizzabile se è soddisfatta una delle seguenti condizioni:
Se la variabile transactionSuccess è true.
Se la variabile transactionSuccess è NULL e
message.status.code è 2xx (operazione riuscita).
revShareGrossPrice
Numero in virgola mobile
Specifica le entrate della transazione per calcolare la quota dello sviluppatore. Apigee calcola
la quota dello sviluppatore solo se hai attivato la condivisione delle entrate nel tuo piano tariffario.
transactionSuccess
boolean
Specifica se la transazione deve essere monetizzata.
Se la variabile è impostata su true, la transazione viene monetizzata.
Se la variabile è impostata su false, la transazione non viene monetizzata.
Se non specifichi questa variabile, la monetizzazione delle transazioni si basa sul
valore del codice di stato HTTP disponibile nella variabile message.status.code.
Se il codice di stato HTTP della risposta è NULL o >=300, una transazione non viene monetizzata; per tutti gli altri codici di stato, la transazione viene monetizzata.
Esempi di assegnazione di valori
I seguenti esempi mostrano come assegnare valori alle variabili di monetizzazione:
currency
L'esempio seguente assegna il valore dell'elemento JSON booking[0].currency
nella risposta alla variabile currency:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis documentation covers monetization variables for Apigee and Apigee hybrid, which are used for rating, calculating revenue share, and analytics within the platform.\u003c/p\u003e\n"],["\u003cp\u003eMonetization variable names are predefined and cannot be created, edited, or deleted, but you can assign either request or response variables to them, and override them via the DataCapture policy.\u003c/p\u003e\n"],["\u003cp\u003eThere are four main monetization variables: \u003ccode\u003ecurrency\u003c/code\u003e, \u003ccode\u003eperUnitPriceMultiplier\u003c/code\u003e, \u003ccode\u003erevShareGrossPrice\u003c/code\u003e, and \u003ccode\u003etransactionSuccess\u003c/code\u003e, each with specific data types and purposes related to transaction monetization and revenue sharing.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etransactionSuccess\u003c/code\u003e variable determines if a transaction should be monetized, based on its boolean value or, if not set, on the HTTP status code.\u003c/p\u003e\n"],["\u003cp\u003eExamples are provided, demonstrating how to assign values to each of the monetization variables using the DataCapture policy, pulling data from JSON payloads and response headers.\u003c/p\u003e\n"]]],[],null,["*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\nApigee uses the monetization variables for rating, calculating revenue share, and analytics. If\nyou want your Apigee analytics to show the monetization information. By using the monetization\nvariables, you can enhance the monetization capabilities of your transactions.\n\nMonetization variables\n\n\nThe monetization variable names are predefined, and you can't create, edit,\nor delete the variables. You can assign either request or response variables to the\nmonetization variables.\n| If you want to override monetization variables, you can do so by capturing them using the [DataCapture policy](/apigee/docs/api-platform/reference/policies/data-capture-policy).\n\nThis table describes the monetization variables available in Apigee:\n\n| Monetization variable | Data type | Description |\n|------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| currency | String | Specifies the currency for calculating the revenue from a transaction. |\n| perUnitPriceMultiplier | Float | Specifies the factor (multiplier) by which the per-transaction cost is multiplied. The per-transaction cost is specified in the rate plan's **[Consumption-based fees](/apigee/docs/api-platform/monetization/manage-rate-plans#create)** pricing. The multiplication is performed for a transaction only if the transaction is monetizable. A transaction is monetizable if any one of the following condition is satisfied: - If the `transactionSuccess` variable is `true`. - If the `transactionSuccess` variable is `NULL` and the `message.status.code` is `2xx` (success). |\n| revShareGrossPrice | Float | 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. |\n| transactionSuccess | boolean | Specifies if the transaction should be monetized. - 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 \\\u003e=300, a transaction is not monetized; for all other status codes, the transaction is monetized. | **Note:** If the value of `transactionSuccess` is anything other than a boolean, then the DataCapture policy evaluates the [`mint.tx_success_result`](/apigee/docs/api-platform/reference/variables-reference#mint) variable to `false`. |\n\n| **Note** :\n|\n| - The monetization variables are not visible in the Apigee's `Admin \u003e Data Collectors` page.\n| - The monetization variables are case sensitive.\n| - Apart from the variable names listed in the table, you cannot provide any other names for the monetization variables.\n| - The monetization variables are not listed in the [organizations.datacollectors.list](/apigee/docs/reference/apis/apigee/rest/v1/organizations.datacollectors/list) API.\n\nValue assignment examples\n\nThe following examples show how to assign values to the monetization variables: \n\ncurrency\n\nThe following example assigns the value of the `booking[0].currency` JSON element\nin the response to the `currency` variable: \n\n```gdscript\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cJSONPayload\u003e\n \u003cJSONPath\u003ebooking[0].currency\u003c/JSONPath\u003e\n \u003c/JSONPayload\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003ecurrency\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\nperUnitPriceMultiplier\n\nThe following example assigns the value of the `booking[0].factor` JSON element in the response to the `perUnitPriceMultiplier` variable: \n\n```gdscript\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cJSONPayload\u003e\n \u003cJSONPath\u003ebooking[0].factor\u003c/JSONPath\u003e\n \u003c/JSONPayload\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003eperUnitPriceMultiplier\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\nrevShareGrossPrice\n\nThe following example assigns the value of the `minPrice` variable in the response header to the `revShareGrossPrice` variable: \n\n```smarty\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cHeader name=\"minPrice\"\u003e\n \u003cPattern ignoreCase=\"true\"\u003e{$}\u003c/Pattern\u003e\n \u003c/Header\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003erevShareGrossPrice\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n \n```\n\ntransactionSuccess\n\nThe following example assigns the value of the `bookingStatus` variable in the response header to the `transactionSuccess` variable: \n\n```smarty\n\u003cCapture\u003e\n \u003cCollect\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003cHeader name=\"bookingStatus\"\u003e\n \u003cPattern ignoreCase=\"true\"\u003e{$}\u003c/Pattern\u003e\n \u003c/Header\u003e\n \u003c/Collect\u003e\n \u003cDataCollector scope=\"monetization\"\u003etransactionSuccess\u003c/DataCollector\u003e\n\u003c/Capture\u003e\n```"]]