Search Unity

UnityEngine.Advertisements.Advertisement' does not contain a definition for `gameId'

Discussion in 'Unity Ads & User Acquisition' started by RSH1, Jan 30, 2019.

  1. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    256
    Since upgrading to 2018.3.3f1 I am getting the error

    UnityEngine.Advertisements.Advertisement' does not contain a definition for `gameId'


    When trying to access Advertisement.gameId

    Despite it still being in the documentation:

    https://docs.unity3d.com/ScriptReference/Advertisements.Advertisement-gameId.html

    My latest project also isn't showing up on the Dashboard website even after enabling Advertisements in 'Services'.

    Why has this value disappeared and how do I now get the project's GameId?
     
  2. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    Can you tell me which version of Unity you upgraded from? There were some older versions of Unity that bundled the Advertisements code with the editor, but that has been decoupled for quite a while now. The property does exist in the Advertisements namespace, but it is only accessible through either the Asset Store or Packman Packages. I will look to see if we can update the documentation to make this clearer going forward.

    For your reference here is the Ads SDK 3.0 integration guide which should walk you through all the steps for getting ads setup in your game. https://unityads.unity3d.com/help/monetization/getting-started