디맨드젠 광고 만들기

디맨드젠 광고는 광고 입찰에서 낙찰될 때 사용자에게 게재되는 광고 소재를 빌드합니다. AdGroupAd 리소스는 결합 필드 ad_details 아래에서 관련 광고 소재 옵션을 구성합니다.

광고 세부정보 구성

디맨드젠 광고에는 네 가지 유형이 있습니다. 각 AdGroupAd 리소스는 단일 유형만 될 수 있습니다. 각 유형은 결합 필드 ad_details 아래의 개별 필드에 구성됩니다.

각 필드의 설명에 관련 광고 유형 요구사항 링크가 제공됩니다. AdGroupAd 리소스를 만들 때는 이러한 필드 중 하나만 채울 수 있습니다.

유형별 이미지 크기 및 해상도 요구사항

각 광고 유형에는 서로 다른 크기의 이미지 애셋이 필요합니다.

다음 표에는 이미지 유형과 관련 파일 제한사항이 나와 있습니다.

이미지 유형
컴패니언 배너

최대 파일 크기: 150KB

크기: 300x60

가로 모드 이미지

최대 파일 크기: 5,120KB

권장 크기: 1200x628, 최소: 600x314

로고 이미지

최대 파일 크기: 5,120KB

권장 크기: 1200x1200, 최소: 128x128

세로 이미지

최대 파일 크기: 5,120KB

권장 크기: 960x1200, 최소: 480x600

정사각형 이미지

최대 파일 크기: 5,120KB

권장 크기: 1200x1200, 최소: 300x300

광고 만들기

디맨드젠 캠페인 동영상 광고를 만드는 방법은 다음과 같습니다.

Python

# Provide the ID of the parent advertiser.
advertiser_id = advertiser-id

# Provide the ID of the parent line item.
ad_group_id = ad-group-id

# Provide the display name of the ad.
display_name = display-name

# Provide the information for the ad creative.
final_ad_url = final-ad-url
call_to_action = call-to-action
headline = headline
long_headline = long-headline
description = description
business_name = business-name
youtube_asset_id = youtube-video-asset-id
logo_asset_id = logo-asset-id

# Create an ad object with example values.
ad_obj = {
    "adGroupId": ad_group_id,
    "displayName": display_name,
    "entityStatus": "ENTITY_STATUS_PAUSED",
    "demandGenVideoAd": {
        "finalUrl": final_ad_url,
        "callToAction": call_to_action,
        "headlines": [headline],
        "longHeadlines": [long_headline],
        "descriptions": [description],
        "businessName": business_name,
        "videos": [{"videoAssetId": youtube_asset_id}],
        "logo": {"assetId": logo_asset_id}
    }
}

# Build and execute request.
response = (
    service.advertisers()
    .adGroupAds()
    .create(advertiserId=advertiser_id, body=ad_obj)
    .execute()
)

# Display the new ad.
print(f"Demand Gen ad {response['name']} was created.")