네이티브 광고를 사용하면 개인 맞춤 광고를 활용하여 더 나은 사용자 환경을 제공할 수 있고, 사용자 환경을 개선하면 사용자 참여가 늘어나 전반적인 수익을 개선할 수 있습니다.
네이티브 광고를 최대한 활용하려면 광고 레이아웃을 앱의 일부인 것처럼
만드는 것이 중요합니다. Google에서는 게시자가 네이티브 광고를 쉽게 시작할 수 있도록
돕기 위해 네이티브 템플릿을 만들었습니다.
네이티브 템플릿은 네이티브 광고용 코드 완성형 보기로, 빠르게 구현하고 손쉽게 수정할 수 있도록
고안되었습니다. 네이티브 템플릿을 사용하면 처음 만드는
네이티브 광고도 몇 분 만에 구현할 수 있고, 많은 코드 없이도 디자인과 스타일을
빠르게 맞춤설정할 수 있습니다. 이 템플릿은 뉴스 피드에 사용되는 리사이클러 뷰,
대화상자 또는 앱의 다른 부분 등 원하는 위치 어디든
배치할 수 있습니다.
네이티브 템플릿은 Android 스튜디오 모듈로 제공되므로
프로젝트에 손쉽게 추가하여 자유롭게 사용할 수 있습니다.
템플릿 크기
템플릿은 작은 크기와 중간 크기의 두 가지 규격으로 제공됩니다. 두 가지 템플릿 모두 TemplateView 클래스를
사용하고 가로세로 비율이 고정되어 있으며, 상위 보기의 너비만큼 확장됩니다.
작은 템플릿
@layout/gnt_small_template_view
작은 템플릿은 리사이클러 뷰 또는 긴 직사각형 광고 보기가 필요할 때
사용하면 좋습니다. 예를 들어 인피드 광고에 사용할 수 있습니다.
중간 템플릿
@layout/gnt_medium_template_view
중간 템플릿은 ½~¾ 페이지 보기로 되어 있지만, 피드 내에 사용할 수도
있습니다. 방문 페이지 또는 스플래시 페이지에 유용합니다.
템플릿을 다양한 게재위치에 자유롭게 사용해 보세요. 물론 필요에 맞게 소스 코드와 XML 파일을 변경할 수도 있습니다.
템플릿의 스타일을 지정하는 방법은 두 가지가 있습니다. 하나는 기본 레이아웃
XML을 사용하는 것이고, 다른 하나는 Google의 NativeTemplateStyle.Builder 객체를 사용하는 것입니다. 위의 코드 샘플은
NativeTemplateStyle.Builder 객체를 사용하여
기본 배경색을 설정하는 방법을 보여주지만 여러 가지 다른 옵션도 있습니다. 아래에 사용 가능한
모든 빌더 메서드가 나와 있습니다. 빌더는 모든 XML 레이아웃 스타일 지정을 재정의하는
NativeTemplateStyle 객체를 반환합니다. XML 레이아웃인
gnt_small_template.xml과 gnt_medium_template.xml은 우리에게 이미 익숙한
Android 스타일 지정 매개변수를 사용합니다.
네이티브 템플릿 스타일 지정을 위한 빌더 메서드
withCallToActionTextTypeface
Typeface callToActionTextTypeface
클릭 유도 문구의 서체입니다.
withCallToActionTextSize
float callToActionTextSize
클릭 유도 문구 텍스트의 크기입니다.
withCallToActionTypefaceColor
int callToActionTypefaceColor
클릭 유도 문구 텍스트의 색상입니다.
withCallToActionBackgroundColor
ColorDrawable callToActionBackgroundColor
클릭 유도 문구의 배경색입니다.
withPrimaryTextTypeface
Typeface primaryTextTypeface
텍스트에서 첫 번째 행의 서체입니다.
withPrimaryTextSize
float primaryTextSize
텍스트에서 첫 번째 행의 텍스트 크기입니다.
withPrimaryTextTypefaceColor
int primaryTextTypefaceColor
텍스트에서 첫 번째 행의 색상입니다.
withPrimaryTextBackgroundColor
ColorDrawable primaryTextBackgroundColor
텍스트에서 첫 번째 행의 배경색입니다.
withSecondaryTextTypeface
Typeface secondaryTextTypeface
텍스트에서 두 번째 행의 서체입니다.
withSecondaryTextSize
float secondaryTextSize
텍스트에서 두 번째 행의 텍스트 크기입니다.
withSecondaryTextTypefaceColor
int secondaryTextTypefaceColor
텍스트에서 두 번째 행의 텍스트 색상입니다.
withSecondaryTextBackgroundColor
ColorDrawable secondaryTextBackgroundColor
텍스트에서 두 번째 행의 배경색입니다.
withTertiaryTextTypeface
Typeface tertiaryTextTypeface
텍스트에서 세 번째 행의 서체입니다.
withTertiaryTextSize
float tertiaryTextSize
텍스트에서 세 번째 행의 텍스트 크기입니다.
withTertiaryTextTypefaceColor
int tertiaryTextTypefaceColor
텍스트에서 세 번째 행의 텍스트 색상입니다.
withTertiaryTextBackgroundColor
ColorDrawable tertiaryTextBackgroundColor
텍스트에서 세 번째 행의 배경색입니다.
withMainBackgroundColor
ColorDrawable mainBackgroundColor
기본 배경색입니다.
참여하기
Google에서는 사용자가 네이티브 광고를 신속하게 개발할 수 있도록 돕기 위해 네이티브 템플릿을 만들었습니다.
새로운 템플릿이나 추가 기능이 필요하면 언제든지 GitHub 저장소에 참여해 주세요. pull 요청을 보내 주시면 Google에서 검토한 후
알려 드립니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-02(UTC)"],[[["\u003cp\u003eNative Templates are pre-built ad views designed for quick implementation and customization in Android apps, helping create a more natural user experience.\u003c/p\u003e\n"],["\u003cp\u003eThese templates come in small and medium sizes, suitable for various placements like recycler views and landing pages, offering flexibility in integration.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can easily install these templates as an Android Studio module by downloading them from GitHub and adding a dependency in their project's \u003ccode\u003ebuild.gradle\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eUsing templates involves including them in your layout XML and then populating them with a native ad when it's loaded, further customizable with styling options.\u003c/p\u003e\n"],["\u003cp\u003eYou can contribute by adding new templates or features through pull requests on the GitHub repository, fostering collaborative development.\u003c/p\u003e\n"]]],["Native Templates provide pre-built views for native ads, simplifying their implementation and customization. To use them, download the module from GitHub and import it into your Android Studio project. There are two template sizes: small (`gnt_small_template_view`) and medium (`gnt_medium_template_view`). Integrate a template into your layout XML and then use `NativeTemplateStyle.Builder` to style it using different text size, color, background and style properties. Next load your native ad by calling `setNativeAd` and make sure you know how to load native ad.\n"],null,["Select platform: [Android](/admob/android/native/templates \"View this page for the Android platform docs.\") [iOS](/admob/ios/native/templates \"View this page for the iOS platform docs.\") [Flutter](/admob/flutter/native/templates \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\n[Download Native Templates](//github.com/googleads/googleads-mobile-android-native-templates)\n| **Key Point:** Before continuing, know how to [load a native\n| ad](/admob/android/native#load-ad). Learn more about native ads in our [Native Ads\n| Playbook](//admob.google.com/home/resources/native-ads-playbook/).\n\n\nUsing native ads you can customize your ads resulting in a better user\nexperience. Better user experiences can increase engagement and improve your\noverall yield.\n\nIn order to get the most out of native ads, it's important to style your ad\nlayouts so that they feel like a natural extension of your app. To help you get\nstarted, we've created Native Templates.\n\nNative Templates are code-complete views for your native ads, designed for fast\nimplementation and easy modification. With Native Templates, you can implement\nyour first native ad in just a few minutes, and you can quickly customize the\nlook and feel without a lot of code. You can place these templates anywhere you\nwant, such as in a recycler view used in a news feed, in a dialog, or anywhere\nelse in your app.\n| **Note:** If you're interested in designing your own native layouts from scratch, return to the [Native Advanced](/admob/android/native/advanced) documentation instead.\n\nOur native templates are provided as an Android Studio module, so it's easy to\ninclude them in your project and use them however you like.\n\nTemplate sizes\n\nThere are two templates: small and medium. They both use the `TemplateView`\nclass and both have a fixed aspect ratio. They will scale to fill the width of\ntheir parent views.\n\nSmall template \n\n @layout/gnt_small_template_view\n\nThe small template is ideal for recycler views, or any time you need a long\nrectangular ad view. For instance you could use it for in-feed ads.\n\nMedium template \n\n @layout/gnt_medium_template_view\n\nThe medium template is meant to be a one-half to three-quarter page view but\ncan also be used in feeds. It is good for landing pages or splash pages.\n\nFeel free to experiment with placement. Of course, you can also change the\nsource code and XML files to suit your requirements.\n\nInstalling the native ad templates\n\nTo install the native templates, simply [download the zip file (using the\n**Clone or download** option on\nGitHub)](//github.com/googleads/googleads-mobile-android-native-templates) and\nimport the module into your existing Android Studio project.\n\n1. Choose **File \\\u003e New \\\u003e Import Module**.\n\n2. Select the `nativetemplates` folder.\n\n3. Add the following line to your app-level `build.gradle` file:\n\n dependencies {\n ...\n implementation project(':nativetemplates')\n ...\n }\n\nUsing the native ad templates\n\nYou can use the template in any layout XML file, like any other view\ngroup.\n\nUsing the templates is a two-step process:\n\n1. First, you need to include the template as part of your layout.\n\n \u003cLinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n tools:context=\".MainActivity\"\n tools:showIn=\"@layout/activity_main\" \u003e\n\n \u003c!-- This is your template view --\u003e\n \u003ccom.google.android.ads.nativetemplates.TemplateView\n android:id=\"@+id/my_template\"\n \u003c!-- this attribute determines which template is used. The other option is\n @layout/gnt_medium_template_view --\u003e\n app:gnt_template_type=\"@layout/gnt_small_template_view\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\" /\u003e\n\n ...\n \u003c/LinearLayout\u003e\n\n2. Next, you need to give your template your native ad when it loads:\n\n MobileAds.initialize(this);\n AdLoader adLoader = new AdLoader.Builder(this, \"ca-app-pub-3940256099942544/2247696110\")\n .forNativeAd(new NativeAd.OnNativeAdLoadedListener() {\n @Override\n public void onNativeAdLoaded(NativeAd nativeAd) {\n NativeTemplateStyle styles = new\n NativeTemplateStyle.Builder().withMainBackgroundColor(background).build();\n TemplateView template = findViewById(R.id.my_template);\n template.setStyles(styles);\n template.setNativeAd(nativeAd);\n }\n })\n .build();\n\n adLoader.loadAd(new AdRequest.Builder().build());\n\nStyles dictionary keys\n\nThere are two ways to style your template: using traditional layout XML and\nusing our `NativeTemplateStyle.Builder` object. The above code sample\ndemonstrates how to use the `NativeTemplateStyle.Builder` object to set the main\nbackground color, but there are a variety of other options as well. Here are all\nof the available builder methods. The builder returns a `NativeTemplateStyle`\nobject which overrides any XML layout styling. The XML layouts\n`gnt_small_template.xml` and `gnt_medium_template.xml` use the same Android\nstyling parameters that you are already familiar with.\n\n| Builder methods for native template style ||\n|------------------------------------|----------------------------------------------------------------------------------------------|\n| `withCallToActionTextTypeface` | `Typeface callToActionTextTypeface` The typeface for the call to action. |\n| `withCallToActionTextSize` | `float callToActionTextSize` The size of the call to action text. |\n| `withCallToActionTypefaceColor` | `int callToActionTypefaceColor` The color of the call to action text. |\n| `withCallToActionBackgroundColor` | `ColorDrawable callToActionBackgroundColor` The background color of the call to action. |\n| `withPrimaryTextTypeface` | `Typeface primaryTextTypeface` The typeface of the first row of text. |\n| `withPrimaryTextSize` | `float primaryTextSize` The size of the first row of text. |\n| `withPrimaryTextTypefaceColor` | `int primaryTextTypefaceColor` The color of the first row of text. |\n| `withPrimaryTextBackgroundColor` | `ColorDrawable primaryTextBackgroundColor` The background color of the first row of text. |\n| `withSecondaryTextTypeface` | `Typeface secondaryTextTypeface` The typeface of the second row of text. |\n| `withSecondaryTextSize` | `float secondaryTextSize` The size of the second row of text. |\n| `withSecondaryTextTypefaceColor` | `int secondaryTextTypefaceColor` The text color of the second row of text. |\n| `withSecondaryTextBackgroundColor` | `ColorDrawable secondaryTextBackgroundColor` The background color of the second row of text. |\n| `withTertiaryTextTypeface` | `Typeface tertiaryTextTypeface` The typeface of the third row of text. |\n| `withTertiaryTextSize` | `float tertiaryTextSize` The size of the third row of text. |\n| `withTertiaryTextTypefaceColor` | `int tertiaryTextTypefaceColor` The text color of the third row of text. |\n| `withTertiaryTextBackgroundColor` | `ColorDrawable tertiaryTextBackgroundColor` The background color of the third row of text. |\n| `withMainBackgroundColor` | `ColorDrawable mainBackgroundColor` The main background color. |\n\nContribute\n\nWe've made Native Templates to help you develop native ads quickly.\nWe'd love to see you contribute to our\n[GitHub](//github.com/googleads/googleads-mobile-android-native-templates)\nrepo to add new templates or features. Send us a pull request and we'll take a\nlook."]]