Please help (858261)

7561723--935479--upload_2021-10-10_13-0-7.png

Did you provide game id for initializing Unity Ads SDK?

/Rasmus

yeah i did i copied the ads initializer script from ads integrations documentation then i changed the name to fit my scrip then i added my game idfor apple, found by clicking ads and scrolling down

can you copy/paste your initialization code here? (there is the “insert code” toolbar button, to format it as code)

using UnityEngine;
using UnityEngine.Advertisements;

public class AdsInitializer : MonoBehaviour, IUnityAdsInitializationListener
{
    [SerializeField] string _androidGameId;
    [SerializeField] string _iOsGameId;
    [SerializeField] bool _testMode = true;
    [SerializeField] bool _enablePerPlacementMode = true;
    private string _gameId;

    void Awake()
    {
        InitializeAds();
    }

    public void InitializeAds()
    {
        _gameId = (Application.platform == RuntimePlatform.IPhonePlayer)
            ? _iOsGameId
            : _androidGameId;
        Advertisement.Initialize(_gameId, _testMode, _enablePerPlacementMode, 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}");
    }
}

Have you set either “_iOsGameId” and/or “_androidGameId” field?

Perhaps insert a line between 21 and 22, to print the actual game id used?

Debug.Log(_gameId);

Then we can see if it’s actually empty?

7561891--935527--upload_2021-10-10_15-3-43.png
i put the code in between line 21 and 22

and yes i have put in the game id in the spector i put in my ios game id but ive left the android empty

ok i changed some code so it actually detects what device on im, it woulnt detect before, so now the game id is my ios one but im still getting the 403 and the "invalid configuration request for gameId: (my ios gameId)

I’m bit out of ideas… You are using the numeric game id listed for your game on https://dashboard.unity3d.com ?

Otherwise send a support request, where you can include your game id. See Technical Support

/Rasmus

7561942--935548--upload_2021-10-10_15-24-56.png
yes i am using the game id from the dashboard and ive tried the same thing for the game id listed when opening ads tab in services no luck, 403 forbidden, this is the right game id and ive checked everything like 7 times now

And you are just running in editor, not on device?

Which Unity editor version and Unity Ads SDK version? then I can see if I can reproduce with your game id here

i am using device, my iphone, im using editor 2020.3.5f1 and 3.7.5 ads sdk

Ok, I can confirm that your game id for some reason doesn’t work (made a simple script to test with). It works when I replace with a game id from one of my own hobby games.

However I don’t have access to see configuration for your game id, so first verify that you have entered the correct one, i.e. the one listed under Ad Units in the Monetization dashboard for your project on https://dashboard.unity3d.com - if that is correct, please reach out to Unity Ads support at Technical Support, as they can help you troubleshoot your configuration on server side.

My test script is below for reference. The ShowAd method is called from a button (it’s just a very simple 2D project)

using UnityEngine;
using UnityEngine.Advertisements;

public class Game : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Initializing ads");
        Advertisement.Initialize("4398850");       
    }

    public void ShowAd()
    {
        Advertisement.Show();
    }
}

Thanks,
Rasmus

7564258--936148--upload_2021-10-11_14-14-24.png
7564258--936151--upload_2021-10-11_14-14-36.png
I have reached out to Unity and I do believe they are trying to figure the issue
You know what I could do, I could copy the project, give it a new Project ID and then reenable unity ads that should generate a new game id, should I try it?