This endpoint should only be used when sending Impression-Level Revenue Data (ILRD) directly via S2S for a mediation provider that is not yet officially integrated with Tenjin.
Authentication #
We authenticate every request sent to the Tenjin server using the API Key as the username in basic auth or as a parameter api_key.
Note: Server-to-server integration is not a standard feature for all Tenjin clients. Please contact your Tenjin account manager if you would like to be whitelisted for this feature.
Generic Endpoint #
Path: https://track.tenjin.io/v0/ad_impressions/
Method: POST
Content-Type: application/x-www-form-urlencoded
Device Information Parameters #
Parameters with * are required
| Parameters | Example | Description |
| bundle_id* | com.tenjin.wordfinder | Bundle ID of the app. |
| advertising_id* | be277924-d076-456d-9a20-3c8dee5663d3 | The raw advertising ID of the device. Please note that the request will only be accepted with a valid device id (any of advertising_id, developer_device_id, and analytics_installation_id). It’s important to stay consistent in sending the device id types. For iOS, it should be IDFA. In the case of no user consent, advertising_id can be empty or all zeros, and IDFV needs to be provided in developer_device_id along with analytics_installation_id For Android, either advertising_id or analytics_installation_id should be provided. |
| developer_device_id* | 5f4dcc3b-5aa5-40e1-8914-7a9c5d5ebf31 | Alternative field for device unique identifier, used when there is no advertising id.For iOS, it should be IDFV. |
| analytics_installation_id* | 91d1c313-dd94-4bd3-bbbb-16c8b7afa054 | Tenjin generated Application Install-specific identifier.Available by customer callback or SDK.Android SDKiOS SDKUnity SDK |
| platform* | ios | Platform of the appiosandroid (with Google Play Store)android_other (with no Google Play Store, e.g. devices with Chinese app stores)amazon (with Amazon App Store) |
| app_version* | 1.5 | The version of your app For Android: String app_version = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName + “.” + context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode) For iOS: [[[NSBundle mainBundle] infoDictionary] objectForKey:@”CFBundleShortVersionString”] |
| app_version_code | 2 | Android only Android App Version: https://developer.android.com/studio/publish/versioning |
| build_id | RQ3A.211001.001 | For Android: String build = String.valueOf(Build.ID) For iOS: @import Darwin.sys.sysctl; NSString *build(void) { size_t bufferSize = 64; NSMutableData *buffer = [[NSMutableData alloc] initWithLength:bufferSize]; int status = sysctlbyname(“kern.osversion”, buffer.mutableBytes, &bufferSize, NULL, 0); if (status != 0) { return nil; } return [[NSString alloc] initWithCString:buffer.mutableBytes encoding:NSUTF8StringEncoding];} |
| carrier | T-2 | Mobile Carrier (Internet Service Provider) |
| connection_type | wifi | mobile/wifi |
| country | US | The ISO locale country codes standard (see Apple documentation for example). |
| device | blueline | Android: android.os.Build.DEVICE (reference)iOS: systemInfo.machine (reference) |
| device_brand | ||
| device_manufacturer | ||
| device_model | Pixel 3 | For Android: String device = Build.MODEL; For iOS: @import Darwin.sys.sysctl; NSString *device(void) { size_t bufferSize = 64; NSMutableData *buffer = [[NSMutableData alloc] initWithLength:bufferSize]; int status = sysctlbyname(“hw.machine”, buffer.mutableBytes, &bufferSize, NULL, 0); if (status != 0) { return nil; } return [[NSString alloc] initWithCString:buffer.mutableBytes encoding:NSUTF8StringEncoding];} |
| device_product | blueline | Android only: build.PRODUCT |
| language | en | Two-letter ISO 639‑1 Code |
| limit_ad_tracking | FALSE | Device limits ad tracking? (true, false) |
| opt_in | TRUE | Device Opt-in consent for GDPR compliance: Tenjin SDK implementation |
| locale | en_US | For Android:String locale = Locale.getDefault().toString() For iOS:[[NSLocale currentLocale] localeIdentifier] |
| os_version | 14 | For Android: String.valueOf(Build.VERSION.SDK_INT) For iOS: [[UIDevice currentDevice] systemVersion] |
| os_version_release | 14.3.1 | For Android only: full os release version |
| timezone | Europe/Ljubljana | |
| user_agent | Linux; U; Android 11; SM-A505FN Build/RP1A.200720.012 | User agent of user’s device |
| screen_height | 2028 | |
| screen_width | 1080 | |
| sent_at | 1693581566830 | Epoch time in milliseconds |
| session_id | f4239af1-cd6f-49e8-8b97-f61a9e81a7e0 | |
| source_app_store | googleplay | Android only: unspecified, googleplay, amazon, other |
| ip_address* (Required to determine device country) | 87.123.246.9 | The User’s IP Address. This is used to look up countries for Google DMA user consent parameters. |
| ad_user_data (Required by Google) | 1 | Google User Consent Signal Parameter: consent of 3P transmission of user level data for ads1 for consent granted0 for consent deniedRemove the parameter entirely from the request (do not set blank) when there is no user consent data |
| ad_personalization (Required by Google) | 1 | Google User Consent Signal Parameter: consent of personalized ads1 for consent granted0 for consent deniedRemove the parameter entirely from the request (do not set blank) when there is no user consent data |
Revenue Information Parameters #
Parameters with * are required
| Parameters | Example | Description |
| ad_revenue_mediation* | max | Mediation platform name, please use values belowmaxironsourceadmobhyperbidtoponcastradplusFor other mediation, use `custom` |
| network_name* | mintegral | Network name that display the ad, usually passed by the mediation provider |
| currency* | USD | The ISO currency codes, e.g. USD, JPY |
| revenue_decimal* | 0.001 | Revenue in decimal for ONE impressiononly require either revenue_decimal or revenue_cpmWhen receive both, revenue_decimal will be prioritized |
| revenue_cpm | 1.0 | Revenue in CPM, equals to revenue_decimal * 1,000 |
| mediation_country | US | Country from mediation provider, in the ISO two-letter country codes e.g. US |
| ad_unit_id | 09807a44b2f855cc | Ad unit ID reported by the winning network |
| ad_format | banner | Format of the ad unit: banner, mrec, xpromo, native, leaderboard/leader, interstitial/inter, rewarded/reward, rewarded_inter/rewarded_interstitial |
| precision | BID | Value passed by mediation, indicates the source of the revenue, like BID, CPM, RATE |
| creative_id | 9299584 | Value passed by mediation, |
| placement | Banner123 | Value passed by mediation for publisher-defined ad placement name |
| network_placement | Banner_name | Placement name of the external Ad Network |
| auction_id | 27d38ef0-847c-11ec-8b8d-3fe5d30476ca_765960010 | Value passed by mediation |
Request Example #
curl -X POST https://track.tenjin.com/v0/ad_impressions/ -H “Content-Type: application/x-www-form-urlencoded” -d ‘api_key=api_key&advertising_id=123&ad_revenue_mediation=max&network_name=google&mediation_country=US¤cy=USD&ad_unit_id=1&ad_format=banner&revenue_decimal=0.01&precision=BID&creative_id=2&placement=banner_1&auction_id=3&bundle_id=com.tenjin.test&platform=ios&ad_user_data=1&ad_personalization=1’