adding ads to game

I did this script but it isn’t doing anything

#if UNITY_IOS
private string gameId = "4434084";
#elif UNITY_ANDROID
private string gameId = "4434085";
#endif
bool testMode = true;
string myPlacementId = "ads";

public void ShowRewardedVideo()
{
Advertisement.Show(myPlacementId);
}

// Implement IUnityAdsListener interface methods:
public void OnUnityAdsReady(string placementId)
{
// If the ready Placement is rewarded, activate the button: 
if (placementId == myPlacementId)
{
ButtonAds.interactable = true;
}
}

public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
// Define conditional logic for each ad completion status:
if (showResult == ShowResult.Finished)
{
TotalClicks += 1000;
}
else if (showResult == ShowResult.Skipped)
{
Debug.Log("player skipped");
}
else if (showResult == ShowResult.Failed)
{
Debug.LogWarning("The ad did not finish due to an error");
}
}

public void OnUnityAdsDidError(string message)
{
// Log the error.
}

public void OnUnityAdsDidStart(string placementId)
{
// Optional actions to take when the end-users trigger an ad.
}

Hi @mr-ddys , thank you for reaching out!

Would you be able to provide us with some more information about this issue?

  • Are you initializing Unity Ads? Please see the example code in our integration guide: Unity developer integration guides
  • Where/how are you loading your ads?
  • Have you seen any test ads?
  • Did you add the placement ID “ads” to your project on the dashboard?

I look forward to hearing from you and sorting this out.