Skip to content

Commit 7eee46b

Browse files
Sporiffuerceg
authored andcommitted
Add new code snippet, note about google contact
1 parent 6d7042e commit 7eee46b

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

doc/english/sdk-to-sdk/admob.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,35 @@ Minimum SDK version required for this feature:
66

77
- **Adjust SDK v4.29.0**
88

9+
> Note: In order to enable this feature, please reach out to your Google point of contact. Your point of contact will be able to activate the feature for you to access it.
10+
911
If you want to track your ad revenue with the Admob SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method.
1012

11-
> Note: If you have any questions about ad revenue tracking with Admob, please contact your dedicated account manager or send an email to [[email protected]](mailto:[email protected])
13+
> Note: If you have any questions about ad revenue tracking with Admob, please contact your dedicated account manager or send an email to [[email protected]](mailto:[email protected]).
1214
1315
### Example
1416

1517
```cs
16-
// initialise with Admob source
17-
AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AdjustAdRevenueSourceAdMob);
18-
19-
// set revenue and currency
20-
adjustAdRevenue.setRevenue(6.66, "USD");
21-
22-
// optional parameters
23-
adjustAdRevenue.setAdImpressionsCount(10);
24-
adjustAdRevenue.setAdRevenueNetwork("network");
25-
adjustAdRevenue.setAdRevenueUnit("unit");
26-
adjustAdRevenue.setAdRevenuePlacement("placement");
27-
28-
// callback & partner parameters
29-
adjustAdRevenue.addCallbackParameter("key", "value");
30-
adjustAdRevenue.addPartnerParameter("key", "value");
31-
32-
// track ad revenue
33-
Adjust.trackAdRevenue(adjustAdRevenue);
18+
private void RequestRewardedAd()
19+
{
20+
// create a rewarded ad
21+
this.rewardedAd = new RewardedAd(<your-ad-unit-id>);
22+
// register for ad paid events
23+
this.rewardedAd.OnPaidEvent += this.HandleAdPaidEvent;
24+
// load a rewarded ad
25+
this.rewardedAd.LoadAd(new AdRequest.Builder().Build());
26+
}
27+
// register for ad paid events
28+
this.rewardedAd.OnPaidEvent += this.HandleAdPaidEvent;
29+
public void HandleAdPaidEvent(object sender, AdValueEventArgs args)
30+
{
31+
// ...
32+
AdValue adValue = args.AdValue;
33+
// send ad revenue info to Adjust
34+
AdjustAdRevenue adRevenue = new AdjustAdRevenue(AdjustConfig.AdjustAdRevenueSourceAdMob);
35+
adRevenue.setRevenue(adValue.Value / 1000000, adValue.CurrencyCode);
36+
Adjust.trackAdRevenue(adRevenue);
37+
}
3438
```
3539

3640
[unity-readme]: ../../../README.md

0 commit comments

Comments
 (0)