{"id":23006352,"url":"https://github.com/unity-package/native-ads-unity","last_synced_at":"2025-06-18T05:36:25.601Z","repository":{"id":265364796,"uuid":"895842436","full_name":"unity-package/native-ads-unity","owner":"unity-package","description":"Admob Native Ads for Unity integration","archived":false,"fork":false,"pushed_at":"2024-11-29T04:12:41.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T00:37:56.906Z","etag":null,"topics":["integrate-native-ads","native-ads","native-ads-unity","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unity-package.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-29T02:53:48.000Z","updated_at":"2024-11-29T04:23:26.000Z","dependencies_parsed_at":"2024-11-29T04:36:33.586Z","dependency_job_id":null,"html_url":"https://github.com/unity-package/native-ads-unity","commit_stats":null,"previous_names":["unity-package/native-ads-unity"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/unity-package/native-ads-unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unity-package%2Fnative-ads-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unity-package%2Fnative-ads-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unity-package%2Fnative-ads-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unity-package%2Fnative-ads-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unity-package","download_url":"https://codeload.github.com/unity-package/native-ads-unity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unity-package%2Fnative-ads-unity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260496233,"owners_count":23018056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["integrate-native-ads","native-ads","native-ads-unity","unity","unity3d"],"created_at":"2024-12-15T08:12:10.780Z","updated_at":"2025-06-18T05:36:20.582Z","avatar_url":"https://github.com/unity-package.png","language":null,"readme":"# Native ads for Unity\nTool native ads for Unity\n\n## Adding the SDK\n### 1. Add the Google Mobile Ads plugin to your project \u003cbr\u003e\n- [Download](https://github.com/googleads/googleads-mobile-unity/releases) and import Google Mobile Ads plugin\n### 2. Add the GoogleMobileAds-native and ToolNativeAd to your project \u003cbr\u003e\n- [Download](https://github.com/unity-package/native-ads-unity/releases) and import  GoogleMobileAds-native and ToolNativeAd sdk\n\n### 3. Force resolve dependencies\nForce resolve the dependencies from Assets/External Dependency Manager/Android Resolver/Force Resolve if the resolver did not open automatically.\n\n## Setup Id\n\n### 1. Add AdMob app ID\n\n- You can open this from Assets/Google Mobile Ads/Settings\n\n![image](https://github.com/user-attachments/assets/9e82b1c8-ae6b-4fc8-ac94-7f263ee8a5b5)\n\n- Add the AdMob application IDs here\n\n\n![image](https://github.com/user-attachments/assets/e563636b-3eac-45e4-a301-e14c77961648)\n\n### 2. Add NativeAd ID\n\n- Via `Tools -\u003e NativeAd Settings` to open NativeAdSettings Window\n\n![Screenshot 2024-11-29 102331](https://github.com/user-attachments/assets/2ceeb3fc-9f47-421a-88b5-762f6a0b5f23)\n\n- Add Native Ads Ids here\n\n![Screenshot 2024-11-29 102336](https://github.com/user-attachments/assets/b4615a5a-b5d9-44ce-87bc-7ee5b78c5ed6)\n\n- `Use TestMode` equals `true`, you will use the Google Mobile Ads test Id\n\n## Scene setup\n\n### 1. Drag and Drop `NativeAdHolderTemplate` prefab \n\n- Drag and drop any of the Native ad unit prefab from the path `Assets \u003e ToolNativeAd \u003e Prefabs \u003e NativeAdHolderTemplate` into your gameplay scene.\n\n\n![Screenshot 2024-11-29 102217](https://github.com/user-attachments/assets/35cad516-b98c-45f5-90cd-fc193018ea71)\n\n  \n![Screenshot 2024-11-29 102239](https://github.com/user-attachments/assets/239cc680-1d8d-4c7b-aa65-6961851f0639)\n\n\n![Screenshot 2024-11-29 102248](https://github.com/user-attachments/assets/40bb07d7-85fb-4bb3-8bf7-fa9f93221801)\n\n### 2. Edit `NativeAdHolderTemplate`\n\n- Edit the size, layout and image PlaceHolder in NativeAdHolder to suit your needs\n\n(Note: When the ad fails to load, PlaceHolder will display)\n\n\n## Handle Script\n\n### 1. FetchAd, Adtive and Block\n\n```csharp\n        public NativeAdHolder nativeAdHolder;\n\n        /// \u003csummary\u003e\n        ///  Fetch and show Native Ad\n        /// \u003c/summary\u003e\n        public void FetchAd()\n        {\n            nativeAdHolder.FetchAd();\n        }\n\n        /// \u003csummary\u003e\n        /// Hide visual NativeAd and show PlaceHolder\n        /// \u003c/summary\u003e\n        public void BlockAd()\n        {\n            nativeAdHolder.Block();\n        }\n\n        /// \u003csummary\u003e\n        /// Show visual NativeAd and hide PlaceHolder\n        /// \u003c/summary\u003e\n        public void ActiveAd()\n        {\n            nativeAdHolder.Active();\n        }\n```\n\nNote: In some cases the click goes through the popup and triggers the NativeAd, call the `Block` method to prevent this. The `Active` method is the opposite of `Block`\n\n### 2. Tracking revenue\n\n```csharp\n        public NativeAdHolder nativeAdHolder;\n        \n        private void OnEnable()\n        {\n            nativeAdHolder.Event_OnAdPaid += OnAdPaid;\n        }\n\n        private void OnDisable()\n        {\n            nativeAdHolder.Event_OnAdPaid -= OnAdPaid;\n        }\n\n        private void OnAdPaid(AdValue adValue)\n        {\n            Debug.Log(adValue.CurrencyCode);\n            Debug.Log(adValue.Value);\n        }\n```\n- Use the `Event OnAdPaid` event to register a callback to perform tracking\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-package%2Fnative-ads-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funity-package%2Fnative-ads-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-package%2Fnative-ads-unity/lists"}