Check out example codes for "unity ads tutorial". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine;
using UnityEngine.Advertisements;

public class InitializeAdsScript : MonoBehaviour { 

    string gameId = "1234567";
    bool testMode = true;

    void Start () {
        Advertisement.Initialize (gameId, testMode);
    }
}

Learn ReactJs, React Native from akashmittal.com