'IUnityAdsInitializationListener' could not be found (are you missing a using directive or an assembly reference?)

So i wanted to add ads to my game but an error shows up when i want to make my AdManager i have used the official script but it gives me an error in the IUnityAdsInitializationListener and in the UnityAdsInitializationError----------------------------------------------------------------------------------------(It doesnt consider the top part as part of script)---------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
using UnityEngine.UI;

public class AdsInitializer : MonoBehaviour, IUnityAdsInitializationListener
{

[SerializeField] string _androidGameId;
[SerializeField] string _iOSGameId;
[SerializeField] bool _testMode = true;
private string _gameId;

void Awake()
{
    InitializeAds();
}

public void InitializeAds()
{
    _gameId = (Application.platform == RuntimePlatform.IPhonePlayer)
        ? _iOSGameId
        : _androidGameId;
    Advertisement.Initialize(_gameId, _testMode, this);
}

public void OnInitializationComplete()
{
    Debug.Log("Unity Ads initialization complete.");
}

public void OnInitializationFailed(UnityAdsInitializationError error, string message)
{
    Debug.Log($"Unity Ads Initialization Failed: {error.ToString()} - {message}");
}

}

Hello. I’m facing the same problem. This article shows which package to install so that there are no errors.Rewarded video ads | Unity. A quick guide about how to implement… | by Fernando Alcantara Santana | Nerd For Tech | Medium