# NativeAdHolder

Native Ad Holders communicate with the PubScaleManager to send ad requests and receive ad fills. It is the packaging unit of a single native ad placement in your scene and handles how and when to make Ad requests.

### Properties:

<table><thead><tr><th width="374">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>AdResizeScale</strong></td><td>Allows adjusting the ad scale to find the optimal fit inside the available space for the ad</td></tr><tr><td><strong>adTag</strong></td><td>This tag is used to identify an Ad placement in your game to track log events. Make sure they are unique.</td></tr><tr><td><strong>canvas</strong></td><td>Reference to the parent canvas component.</td></tr><tr><td><strong>placeholder</strong></td><td>This game object will be shown before the Ad loads and will get disabled once the ad is loaded.</td></tr><tr><td><strong>adDisplay</strong></td><td>Reference to the default <a href="https://github.com/GreedyGame/sdkone-unity_native_ads_plugin/wiki/NativeAdDisplayHandler">NativeAdDisplayHandler</a> component which will determine how the native ad is shown once it is loaded.</td></tr><tr><td>MORE FORMATS (Optional)</td><td>You can add more display variations. At runtime, the plugin selects the best variant based on the ad received.</td></tr><tr><td><strong>landscapeAdFormats</strong></td><td>List of NativeAdDisplayHandlers tailored for Ads with a Landscape product image.</td></tr><tr><td><strong>portraitAdFormats</strong></td><td>List of NativeAdDisplayHandler tailored for Ads with a Portrait product image.</td></tr><tr><td><strong>nonMediaType</strong></td><td>List of NativeAdDisplayHandler which handles cases when the advertisement does not have a product image.</td></tr><tr><td></td><td></td></tr><tr><td><strong>UseExtraFormats</strong></td><td>Boolean that tells the SDK to search the extra landscape and portrait formats at runtime when set to true. Otherwise, it will use only the default format assigned to adDisplay field.</td></tr><tr><td></td><td></td></tr><tr><td></td><td><strong>AD FETCH OPTIONS</strong></td></tr><tr><td><strong>AutoFetch</strong></td><td>If enabled, the Ad will automatically be requested in OnEnable for the Game Object</td></tr><tr><td><strong>TriggerFetchWithCollider</strong></td><td>If enabled, the Ad request will be made when a collider with a certain tag enters inside the bounds of the attached collider component. Make sure the IsTrigger is checked for the collider</td></tr><tr><td><strong>TriggerOnCollisionWithTag</strong></td><td>The game object Tag that will trigger the Ad request if TriggerFetchWithCollider is enabled</td></tr><tr><td></td><td>If both the above are deselected, the Ad Holder expects you to invoke FetchAd() manually from another script</td></tr><tr><td></td><td></td></tr><tr><td><strong>RefreshRate</strong></td><td>The Native Ad Holder makes a new ad request using this delay value after an impression is registered on the current ad displayed. The recommended value is 30s after an impression.</td></tr></tbody></table>

### Public Methods:

All these methods can be overloaded

| Name                                       | Description                                                                                                                                                                                                                                          |
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FetchAd**                                | Generates request for a new Ad.                                                                                                                                                                                                                      |
| **HideAd**                                 | <p>(⚠️ Native Ads can register click events even if they are overlapped by other UI components.)<br><br>The AdDisplayHandler is disabled, and the placeholder object is activated. This prevents the ad from registering an unintentional click.</p> |
| **UnHideAd**                               | Re-show the ad once the overlapping UI is not active                                                                                                                                                                                                 |
| **StopRefresh**                            | Stops the Ad unit refresh calls.                                                                                                                                                                                                                     |
| **ResetTriggerByColliderAdFetchCondition** | Resets the condition to trigger a FetchAd call when using Collider as trigger                                                                                                                                                                        |

### Events

| Name                                        | Description                                                                                                     |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Event\_AdRequest**                        | The event is raised before the referenced **NativeAdHolder** component requests a new Ad from the ad cache.     |
| **Event\_OnNativeAdActive**                 | This static event is raised when any **NativeAdHolder** component gets activated in the scene.                  |
| **Event\_OnAdLoaded**                       | The event is raised when the referenced **NativeAdHolder** component receives its Ad fill from the ad cache.    |
| **Event\_OnAdFillNotReceivedInThisAttempt** | The event is raised when there is no ad present in the cache at the time of the request by the NativeAdHolder   |
| **Event\_OnAdImpression**                   | The event is raised when the referenced **NativeAdHolder** component registers an impression for the loaded Ad. |
| **Event\_OnAdClicked**                      | The event is raised when the referenced **NativeAdHolder** component registers a click for the active Ad.       |
| **Event\_OnAdValuePaid**                    | The event is raised when the impression-level revenue is available for the current impression.                  |



* Please make sure to subscribe to Event\_AdRequest in the Awake() callback in order not to miss the Auto-Fetch **Event\_AdRequest,** which is triggered in OnEnable()&#x20;

