---
title: Unity Plugin – CloudX
description: "The Tenjin SDK can listen to CloudX impression level revenue data and send revenue events to Tenjin. This integration will send revenue related data for each ad impression served from CloudX. Here are the steps to integrate: 1. Install the…"
url: "https://tenjin.com/zh/docs/unity-plugin-cloudx/"
updated: "2026-06-15"
category: Revenue Measurement / Ad Revenue / Ad Revenue (Ad Mediation) Setup / CloudX
---

# Unity Plugin – CloudX

The Tenjin SDK can listen to CloudX impression level revenue data and send revenue events to Tenjin. This integration will send revenue related data for each ad impression served from CloudX. Here are the steps to integrate:

1. Install the CloudX Unity SDK by following the integration guide:[https://docs.cloudx.io/en/unity/integration](https://docs.cloudx.io/en/unity/integration) Please ensure you have the latest Tenjin Unity SDK installed (which includes the CloudXImpressionFromJSON() method).
2. Pass the revenue data to Tenjin from the CloudX revenue callback, using the following sample code.

### C#

 C#

```
using System.Globalization;
using UnityEngine;
using CloudX; // CloudX Unity SDK namespace

[System.Serializable]
public class TenjinCloudXImpressionData
{
    public string format;
    public string ad_unit_id;
    public string network_name;
    public string network_placement;
    public string placement;
    public double revenue;
    public string currency;
}

// Subscribe to the CloudX revenue event for each ad type (banner, MREC,
// interstitial, rewarded).
// Example: CloudXAdsCallbacks.Banner.OnAdRevenuePaid += OnCloudXRevenuePaid;

private void OnCloudXRevenuePaid(CloudXAd cloudXAd)
{
    double parsedRevenue = 0.0;
    CultureInfo invCulture = CultureInfo.InvariantCulture;

    // Parse revenue with culture-invariant formatting
    double.TryParse(
        string.Format(invCulture, "{0}", cloudXAd.Revenue),
        NumberStyles.Any,
        invCulture,
        out parsedRevenue
    );

    // Create impression data object for serialization
    var impressionDataObject = new TenjinCloudXImpressionData
    {
        ad_format         = cloudXAd.AdFormat.ToString()    ?? "",
        ad_unit_id        = cloudXAd.AdUnitId               ?? "",
        network_name      = cloudXAd.NetworkName            ?? "",
        network_placement = cloudXAd.NetworkPlacement       ?? "",
        placement         = cloudXAd.Placement              ?? "",
        revenue           = parsedRevenue,
        currency          = "USD"
    };

    // Convert to JSON string using JsonUtility
    string jsonString = JsonUtility.ToJson(impressionDataObject);

    // Send to Tenjin
    Tenjin.getInstance("<YOUR-TENJIN-SDK-KEY>").CloudXImpressionFromJSON(jsonString);
    Debug.Log("Sent CloudX impression to Tenjin: " + jsonString);
}
```

Here is an example impression level revenue data entry from CloudX:

| **Parameter** | **Required?** | **Example** |
| --- | --- | --- |
| format | No | Banner, Mrec, Interstitial, Rewarded |
| ad_unit_id | No | abc-123-banner |
| network_name | No | meta |
| network_placement | No | 1234567890_9876543210 |
| placement | No | home_screen |
| revenue | Yes | 0.0123 |
| currency | No | USD |

---

reference:[https://docs.cloudx.io/en/unity/integration](https://docs.cloudx.io/en/unity/integration)
