Google Ads API로 동적 검색 광고 (DSA)를 설정하려면 다음 단계를 따르세요.
- 캠페인을 만들고 도메인을 지정합니다.
- DSA와 관련된 기능의 광고 그룹을 만듭니다.
- DSA를 하나 이상 만듭니다.
- 캠페인에 DSA를 표시하기 위한 기준을 하나 이상 지정합니다.
캠페인 만들기
캠페인에서 DSA를 사용할 것이라고 Google Ads에 알리려면 먼저 advertising_channel_type
필드를 AdvertisingChannelType.SEARCH
로 설정하여 Campaign
를 만들어야 합니다. DSA가 작동할 도메인도 지정합니다. 이렇게 하려면 DynamicSearchAdsSetting
를 사용하여 Campaign
의 필드 dynamic_search_ads_setting
를 설정합니다.
다음 예에서는 DSA 캠페인을 만듭니다.
자바
private static String addCampaign( GoogleAdsClient googleAdsClient, long customerId, String budgetResourceName) { // Creates the campaign. Campaign campaign = Campaign.newBuilder() .setName("Interplanetary Cruise #" + getPrintableDateTime()) .setAdvertisingChannelType(AdvertisingChannelType.SEARCH) .setStatus(CampaignStatus.PAUSED) .setManualCpc(ManualCpc.newBuilder().build()) .setCampaignBudget(budgetResourceName) // Enables the campaign for DSAs. .setDynamicSearchAdsSetting( DynamicSearchAdsSetting.newBuilder() .setDomainName("example.com") .setLanguageCode("en") .build()) .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd")) .setEndDate(new DateTime().plusDays(30).toString("yyyyMMdd")) .build(); // Creates the operation. CampaignOperation operation = CampaignOperation.newBuilder().setCreate(campaign).build(); // Creates the campaign service client. try (CampaignServiceClient campaignServiceClient = googleAdsClient.getLatestVersion().createCampaignServiceClient()) { // Adds the campaign. MutateCampaignsResponse response = campaignServiceClient.mutateCampaigns( Long.toString(customerId), ImmutableList.of(operation)); String campaignResourceName = response.getResults(0).getResourceName(); // Displays the results. System.out.printf("Added campaign with resource name '%s'.%n", campaignResourceName); return campaignResourceName; } }
C#
private static string AddCampaign(GoogleAdsClient client, long customerId, string budgetResourceName) { // Get the CampaignService. CampaignServiceClient campaignService = client.GetService(Services.V18.CampaignService); // Create the campaign. Campaign campaign = new Campaign() { Name = "Interplanetary Cruise #" + ExampleUtilities.GetRandomString(), AdvertisingChannelType = AdvertisingChannelType.Search, Status = CampaignStatus.Paused, ManualCpc = new ManualCpc(), CampaignBudget = budgetResourceName, // Enable the campaign for DSAs. DynamicSearchAdsSetting = new DynamicSearchAdsSetting() { DomainName = "example.com", LanguageCode = "en" }, StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"), EndDate = DateTime.Now.AddDays(30).ToString("yyyyMMdd") }; // Create the operation. CampaignOperation operation = new CampaignOperation() { Create = campaign }; // Add the campaign. MutateCampaignsResponse response = campaignService.MutateCampaigns(customerId.ToString(), new CampaignOperation[] { operation }); // Displays the result. string campaignResourceName = response.Results[0].ResourceName; Console.WriteLine($"Added campaign with resource name '{campaignResourceName}'."); return campaignResourceName; }
PHP
private static function createCampaign( GoogleAdsClient $googleAdsClient, int $customerId, string $campaignBudgetResourceName ) { $campaign = new Campaign([ 'name' => 'Interplanetary Cruise #' . Helper::getPrintableDatetime(), 'advertising_channel_type' => AdvertisingChannelType::SEARCH, 'status' => CampaignStatus::PAUSED, 'manual_cpc' => new ManualCpc(), 'campaign_budget' => $campaignBudgetResourceName, // Enables the campaign for DSAs. 'dynamic_search_ads_setting' => new DynamicSearchAdsSetting([ 'domain_name' => 'example.com', 'language_code' => 'en' ]), // Optional: Sets the start and end dates for the campaign, beginning one day from // now and ending a month from now. 'start_date' => date('Ymd', strtotime('+1 day')), 'end_date' => date('Ymd', strtotime('+1 month')) ]); // Creates a campaign operation. $campaignOperation = new CampaignOperation(); $campaignOperation->setCreate($campaign); // Issues a mutate request to add campaigns. $campaignServiceClient = $googleAdsClient->getCampaignServiceClient(); /** @var MutateCampaignsResponse $campaignResponse */ $campaignResponse = $campaignServiceClient->mutateCampaigns( MutateCampaignsRequest::build($customerId, [$campaignOperation]) ); $campaignResourceName = $campaignResponse->getResults()[0]->getResourceName(); printf("Added campaign named '%s'.%s", $campaignResourceName, PHP_EOL); return $campaignResourceName; }
Python
def create_campaign(client, customer_id, budget_resource_name): """Creates a Dynamic Search Ad Campaign under the given customer ID. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID str. budget_resource_name: a resource_name str for a Budget Returns: A resource_name str for the newly created Campaign. """ # Retrieve a new campaign operation object. campaign_operation = client.get_type("CampaignOperation") campaign = campaign_operation.create campaign.name = f"Interplanetary Cruise #{uuid4()}" campaign.advertising_channel_type = ( client.enums.AdvertisingChannelTypeEnum.SEARCH ) # Recommendation: Set the campaign to PAUSED when creating it to prevent the # ads from immediately serving. Set to ENABLED once you've added targeting # and the ads are ready to serve. campaign.status = client.enums.CampaignStatusEnum.PAUSED campaign.manual_cpc.enhanced_cpc_enabled = True campaign.campaign_budget = budget_resource_name # Required: Enable the campaign for DSAs by setting the campaign's dynamic # search ads setting domain name and language. campaign.dynamic_search_ads_setting.domain_name = "example.com" campaign.dynamic_search_ads_setting.language_code = "en" # Optional: Sets the start and end dates for the campaign, beginning one day # from now and ending a month from now. campaign.start_date = (datetime.now() + timedelta(days=1)).strftime( "%Y%m%d" ) campaign.end_date = (datetime.now() + timedelta(days=30)).strftime("%Y%m%d") # Retrieve the campaign service. campaign_service = client.get_service("CampaignService") # Issues a mutate request to add campaign. response = campaign_service.mutate_campaigns( customer_id=customer_id, operations=[campaign_operation] ) resource_name = response.results[0].resource_name print(f'Created campaign with resource_name: "{resource_name}"')
Ruby
def create_campaign(client, customer_id, budget_resource_name) campaign = client.resource.campaign do |c| c.name = "Interplanetary Cruise #{(Time.now.to_f * 1000).to_i}" c.advertising_channel_type = :SEARCH c.status = :PAUSED c.manual_cpc = client.resource.manual_cpc c.campaign_budget = budget_resource_name c.dynamic_search_ads_setting = client.resource.dynamic_search_ads_setting do |s| s.domain_name = "example.com" s.language_code = "en" end c.start_date = DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d') c.end_date = DateTime.parse(Date.today.next_year.to_s).strftime('%Y%m%d') end operation = client.operation.create_resource.campaign(campaign) response = client.service.campaign.mutate_campaigns( customer_id: customer_id, operations: [operation], ) puts("Created campaign with ID: #{response.results.first.resource_name}") response.results.first.resource_name end
Perl
sub create_campaign { my ($api_client, $customer_id, $campaign_budget_resource_name) = @_; # Create a campaign. my $campaign = Google::Ads::GoogleAds::V18::Resources::Campaign->new({ name => "Interplanetary Cruise #" . uniqid(), advertisingChannelType => SEARCH, status => Google::Ads::GoogleAds::V18::Enums::CampaignStatusEnum::PAUSED, manualCpc => Google::Ads::GoogleAds::V18::Common::ManualCpc->new(), campaignBudget => $campaign_budget_resource_name, # Enable the campaign for DSAs. dynamicSearchAdsSetting => Google::Ads::GoogleAds::V18::Resources::DynamicSearchAdsSetting->new({ domainName => "example.com", languageCode => "en" } ), # Optional: Set the start and end dates for the campaign, beginning one day from # now and ending a month from now. startDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24)), endDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24 * 30)), }); # Create a campaign operation. my $campaign_operation = Google::Ads::GoogleAds::V18::Services::CampaignService::CampaignOperation-> new({create => $campaign}); # Add the campaign. my $campaigns_response = $api_client->CampaignService()->mutate({ customerId => $customer_id, operations => [$campaign_operation]}); my $campaign_resource_name = $campaigns_response->{results}[0]{resourceName}; printf "Created campaign '%s'.\n", $campaign_resource_name; return $campaign_resource_name; }
광고 그룹 만들기
DSA 기능을 사용하려면 type
필드를 SEARCH_DYNAMIC_ADS
로 설정하여 AdGroup
를 만들어야 합니다.
이 광고 그룹 유형에는 다음과 같은 제한사항이 적용됩니다.
- 이 광고 그룹 유형은 검색 캠페인에만 추가할 수 있습니다.
- 캠페인 수준에서 유효한
DynamicSearchAdsSetting
가 설정되어야 합니다. - 광고 그룹을 추가합니다. 이 설정이 누락되면
AdGroupError.CANNOT_ADD_ADGROUP_OF_TYPE_DSA_TO_CAMPAIGN_WITHOUT_DSA_SETTING
오류가 발생합니다. - 이 광고그룹 유형에서는 검색 키워드를 사용할 수 없습니다. 잠재고객, 동적 광고 타겟, 제외 키워드는 허용됩니다.
- 모든 광고 그룹과 마찬가지로
type
필드는 생성 후에는 변경할 수 없습니다. - 이 광고 그룹에서는 DSA와 관련된 광고 형식만 허용됩니다.
아래 코드 예에서는 SEARCH_DYNAMIC_ADS
광고 그룹을 만드는 방법을 보여줍니다.
자바
private static String addAdGroup( GoogleAdsClient googleAdsClient, long customerId, String campaignResourceName) { // Creates the ad group. AdGroup adGroup = AdGroup.newBuilder() .setName("Earth to Mars Cruises #" + getPrintableDateTime()) .setCampaign(campaignResourceName) .setType(AdGroupType.SEARCH_DYNAMIC_ADS) .setStatus(AdGroupStatus.PAUSED) .setTrackingUrlTemplate("http://tracker.examples.com/traveltracker/{escapedlpurl}") .setCpcBidMicros(50_000) .build(); // Creates the operation. AdGroupOperation operation = AdGroupOperation.newBuilder().setCreate(adGroup).build(); // Creates the ad group service client. try (AdGroupServiceClient adGroupServiceClient = googleAdsClient.getLatestVersion().createAdGroupServiceClient()) { MutateAdGroupsResponse response = adGroupServiceClient.mutateAdGroups( Long.toString(customerId), ImmutableList.of(operation)); String adGroupResourceName = response.getResults(0).getResourceName(); // Displays the results. System.out.printf("Added ad group with resource name '%s'.%n", adGroupResourceName); return adGroupResourceName; } }
C#
private static string AddAdGroup(GoogleAdsClient client, long customerId, string campaignResourceName) { // Get the AdGroupService. AdGroupServiceClient adGroupService = client.GetService(Services.V18.AdGroupService); // Create the ad group. AdGroup adGroup = new AdGroup() { Name = "Earth to Mars Cruises #" + ExampleUtilities.GetRandomString(), Campaign = campaignResourceName, Type = AdGroupType.SearchDynamicAds, Status = AdGroupStatus.Paused, TrackingUrlTemplate = "http://tracker.examples.com/traveltracker/{escapedlpurl}", CpcBidMicros = 50_000 }; // Create the operation. AdGroupOperation operation = new AdGroupOperation() { Create = adGroup }; // Add the ad group. MutateAdGroupsResponse response = adGroupService.MutateAdGroups(customerId.ToString(), new AdGroupOperation[] { operation }); // Display the results. string adGroupResourceName = response.Results[0].ResourceName; Console.WriteLine($"Added ad group with resource name '{adGroupResourceName}'."); return adGroupResourceName; }
PHP
private static function createAdGroup( GoogleAdsClient $googleAdsClient, int $customerId, string $campaignResourceName ) { // Constructs an ad group and sets an optional CPC value. $adGroup = new AdGroup([ 'name' => 'Earth to Mars Cruises #' . Helper::getPrintableDatetime(), 'campaign' => $campaignResourceName, 'status' => AdGroupStatus::PAUSED, 'type' => AdGroupType::SEARCH_DYNAMIC_ADS, 'tracking_url_template' => 'http://tracker.examples.com/traveltracker/{escapedlpurl}', 'cpc_bid_micros' => 10000000 ]); // Creates an ad group operation. $adGroupOperation = new AdGroupOperation(); $adGroupOperation->setCreate($adGroup); // Issues a mutate request to add the ad groups. $adGroupServiceClient = $googleAdsClient->getAdGroupServiceClient(); /** @var MutateAdGroupsResponse $adGroupResponse */ $adGroupResponse = $adGroupServiceClient->mutateAdGroups( MutateAdGroupsRequest::build($customerId, [$adGroupOperation]) ); $adGroupResourceName = $adGroupResponse->getResults()[0]->getResourceName(); printf("Added ad group named '%s'.%s", $adGroupResourceName, PHP_EOL); return $adGroupResourceName; }
Python
def create_ad_group(client, customer_id, campaign_resource_name): """Creates a Dynamic Search Ad Group under the given Campaign. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID str. campaign_resource_name: a resource_name str for a Campaign. Returns: A resource_name str for the newly created Ad Group. """ # Retrieve a new ad group operation object. ad_group_operation = client.get_type("AdGroupOperation") # Create an ad group. ad_group = ad_group_operation.create # Required: set the ad group's type to Dynamic Search Ads. ad_group.type_ = client.enums.AdGroupTypeEnum.SEARCH_DYNAMIC_ADS ad_group.name = f"Earth to Mars Cruises {uuid4()}" ad_group.campaign = campaign_resource_name ad_group.status = client.enums.AdGroupStatusEnum.PAUSED # Recommended: set a tracking URL template for your ad group if you want to # use URL tracking software. ad_group.tracking_url_template = ( "http://tracker.example.com/traveltracker/{escapedlpurl}" ) # Optional: Set the ad group bid value. ad_group.cpc_bid_micros = 10000000 # Retrieve the ad group service. ad_group_service = client.get_service("AdGroupService") # Issues a mutate request to add the ad group. response = ad_group_service.mutate_ad_groups( customer_id=customer_id, operations=[ad_group_operation] ) resource_name = response.results[0].resource_name print(f'Created Ad Group with resource_name: "{resource_name}"')
Ruby
def create_ad_group(client, customer_id, campaign_resource_name) ad_group = client.resource.ad_group do |ag| ag.type = :SEARCH_DYNAMIC_ADS ag.name = "Earth to Mars Cruises #{(Time.now.to_f * 1000).to_i}" ag.campaign = campaign_resource_name ag.status = :PAUSED ag.tracking_url_template = "http://tracker.example.com/traveltracker/{escapedlpurl}" ag.cpc_bid_micros = 3_000_000 end operation = client.operation.create_resource.ad_group(ad_group) response = client.service.ad_group.mutate_ad_groups( customer_id: customer_id, operations: [operation], ) puts("Created ad group with ID: #{response.results.first.resource_name}") response.results.first.resource_name end
Perl
sub create_ad_group { my ($api_client, $customer_id, $campaign_resource_name) = @_; # Construct an ad group and set an optional CPC value. my $ad_group = Google::Ads::GoogleAds::V18::Resources::AdGroup->new({ name => "Earth to Mars Cruises #" . uniqid(), campaign => $campaign_resource_name, status => Google::Ads::GoogleAds::V18::Enums::AdGroupStatusEnum::PAUSED, type => SEARCH_DYNAMIC_ADS, trackingUrlTemplate => "http://tracker.examples.com/traveltracker/{escapedlpurl}", cpcBidMicros => 3000000 }); # Create an ad group operation. my $ad_group_operation = Google::Ads::GoogleAds::V18::Services::AdGroupService::AdGroupOperation-> new({create => $ad_group}); # Add the ad group. my $ad_groups_response = $api_client->AdGroupService()->mutate({ customerId => $customer_id, operations => [$ad_group_operation]}); my $ad_group_resource_name = $ad_groups_response->{results}[0]{resourceName}; printf "Created ad group '%s'.\n", $ad_group_resource_name; return $ad_group_resource_name; }
DSA 만들기
실제 DSA를 만들려면 ExpandedDynamicSearchAdInfo
객체를 사용하고 다음 필드를 설정해야 합니다.
- 필수:
description
- 선택사항:
description2
이 광고의 광고 제목, 표시 URL, 최종 URL은 캠페인 수준에서 설정된 DynamicSearchAdsSetting
에서 제공하는 도메인 이름별 정보에 따라 게재 시 자동으로 생성됩니다.
자바
private static void addExpandedDSA( GoogleAdsClient googleAdsClient, long customerId, String adGroupResourceName) { // Creates an ad group ad. AdGroupAd adGroupAd = AdGroupAd.newBuilder() .setAdGroup(adGroupResourceName) .setStatus(AdGroupAdStatus.PAUSED) // Sets the ad as an expanded dynamic search ad .setAd( Ad.newBuilder() .setExpandedDynamicSearchAd( ExpandedDynamicSearchAdInfo.newBuilder() .setDescription("Buy tickets now!") .build()) .build()) .build(); // Creates the operation. AdGroupAdOperation operation = AdGroupAdOperation.newBuilder().setCreate(adGroupAd).build(); // Creates the ad group ad service client. try (AdGroupAdServiceClient adGroupAdServiceClient = googleAdsClient.getLatestVersion().createAdGroupAdServiceClient()) { // Adds the dynamic search ad. MutateAdGroupAdsResponse response = adGroupAdServiceClient.mutateAdGroupAds( Long.toString(customerId), ImmutableList.of(operation)); // Displays the response. System.out.printf( "Added ad group ad with resource name '%s'.%n", response.getResults(0).getResourceName()); } }
C#
private static void AddExpandedDSA(GoogleAdsClient client, long customerId, string adGroupResourceName) { // Get the AdGroupAdService. AdGroupAdServiceClient adGroupAdService = client.GetService(Services.V18.AdGroupAdService); // Create an ad group ad. AdGroupAd adGroupAd = new AdGroupAd() { AdGroup = adGroupResourceName, Status = AdGroupAdStatus.Paused, // Set the ad as an expanded dynamic search ad. Ad = new Ad() { ExpandedDynamicSearchAd = new ExpandedDynamicSearchAdInfo() { Description = "Buy tickets now!" } } }; // Create the operation. AdGroupAdOperation operation = new AdGroupAdOperation() { Create = adGroupAd }; // Add the dynamic search ad. MutateAdGroupAdsResponse response = adGroupAdService.MutateAdGroupAds( customerId.ToString(), new AdGroupAdOperation[] { operation }); // Display the response. Console.WriteLine($"Added ad group ad with resource name " + $"'{response.Results[0].ResourceName}'."); }
PHP
private static function createExpandedDSA( GoogleAdsClient $googleAdsClient, int $customerId, string $adGroupResourceName ) { $adGroupAd = new AdGroupAd([ 'ad_group' => $adGroupResourceName, 'status' => AdGroupAdStatus::PAUSED, 'ad' => new Ad([ 'expanded_dynamic_search_ad' => new ExpandedDynamicSearchAdInfo([ 'description' => 'Buy tickets now!' ]) ]) ]); $adGroupAdOperation = new AdGroupAdOperation(); $adGroupAdOperation->setCreate($adGroupAd); // Issues a mutate request to add the ad group ads. $adGroupAdServiceClient = $googleAdsClient->getAdGroupAdServiceClient(); /** @var MutateAdGroupAdsResponse $adGroupAdResponse */ $adGroupAdResponse = $adGroupAdServiceClient->mutateAdGroupAds( MutateAdGroupAdsRequest::build($customerId, [$adGroupAdOperation]) ); $adGroupAdResourceName = $adGroupAdResponse->getResults()[0]->getResourceName(); printf("Added ad group ad named '%s'.%s", $adGroupAdResourceName, PHP_EOL); return $adGroupAdResourceName; }
Python
def create_expanded_dsa(client, customer_id, ad_group_resource_name): """Creates a dynamic search ad under the given ad group. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID str. ad_group_resource_name: a resource_name str for an Ad Group. """ # Retrieve a new ad group ad operation object. ad_group_ad_operation = client.get_type("AdGroupAdOperation") # Create and expanded dynamic search ad. This ad will have its headline, # display URL and final URL auto-generated at serving time according to # domain name specific information provided by DynamicSearchAdSetting at # the campaign level. ad_group_ad = ad_group_ad_operation.create # Optional: set the ad status. ad_group_ad.status = client.enums.AdGroupAdStatusEnum.PAUSED # Set the ad description. ad_group_ad.ad.expanded_dynamic_search_ad.description = "Buy tickets now!" ad_group_ad.ad_group = ad_group_resource_name # Retrieve the ad group ad service. ad_group_ad_service = client.get_service("AdGroupAdService") # Submit the ad group ad operation to add the ad group ad. response = ad_group_ad_service.mutate_ad_group_ads( customer_id=customer_id, operations=[ad_group_ad_operation] ) resource_name = response.results[0].resource_name print(f'Created Ad Group Ad with resource_name: "{resource_name}"')
Ruby
def create_expanded_dsa(client, customer_id, ad_group_resource_name) ad_group_ad = client.resource.ad_group_ad do |aga| aga.status = :PAUSED aga.ad = client.resource.ad do |ad| ad.expanded_dynamic_search_ad = client.resource.expanded_dynamic_search_ad_info do |info| info.description = "Buy tickets now!" end end aga.ad_group = ad_group_resource_name end operation = client.operation.create_resource.ad_group_ad(ad_group_ad) response = client.service.ad_group_ad.mutate_ad_group_ads( customer_id: customer_id, operations: [operation], ) puts("Created ad group ad with ID: #{response.results.first.resource_name}") end
Perl
sub create_expanded_dsa { my ($api_client, $customer_id, $ad_group_resource_name) = @_; # Create an ad group ad. my $ad_group_ad = Google::Ads::GoogleAds::V18::Resources::AdGroupAd->new({ adGroup => $ad_group_resource_name, status => Google::Ads::GoogleAds::V18::Enums::AdGroupAdStatusEnum::PAUSED, ad => Google::Ads::GoogleAds::V18::Resources::Ad->new({ expandedDynamicSearchAd => Google::Ads::GoogleAds::V18::Common::ExpandedDynamicSearchAdInfo-> new({ description => "Buy tickets now!" })})}); # Create an ad group ad operation. my $ad_group_ad_operation = Google::Ads::GoogleAds::V18::Services::AdGroupAdService::AdGroupAdOperation ->new({create => $ad_group_ad}); # Add the ad group ad. my $ad_group_ads_response = $api_client->AdGroupAdService()->mutate({ customerId => $customer_id, operations => [$ad_group_ad_operation]}); my $ad_group_ad_resource_name = $ad_group_ads_response->{results}[0]{resourceName}; printf "Created ad group ad '%s'.\n", $ad_group_ad_resource_name; return $ad_group_ad_resource_name; }
final_urls
필드는 Google Ads에서 DSA를 만들 때 계산됩니다. 따라서 DSA를 만들 때 이 필드를 설정할 수 없습니다. URL 추적 소프트웨어를 사용하려면 tracking_url_template
필드를 사용하여 필요한 추가 추적 매개변수 또는 리디렉션을 지정할 수 있습니다. 이 필드를 지정할 때 Google Ads에서 일치하는 최종 URL을 삽입할 수 있도록 다음 매개변수 중 하나를 포함해야 합니다.
매개변수 | 설명 |
---|---|
{unescapedlpurl} |
이스케이프 처리되지 않은 방문 페이지 URL: 끝에 항목을 추가하려는 경우(예:
|
{escapedlpurl} |
이스케이프 처리된 (URL 인코딩된) 방문 페이지 URL: 추적기로 리디렉션하려는 경우 다음과 같이 입력합니다.
|
{lpurlpath} |
계산된 URL의 경로 및 쿼리 매개변수만 포함됩니다(예:
|
{lpurl} |
방문 페이지 URL의
|
예를 들면 다음과 같습니다.
자바
dsa.setTrackingUrlTemplate(
StringValue.of("http://example.com/traveltracker/{escapedlpurl}"));
DSA 기준 지정
마지막으로 DSA 게재를 트리거하는 몇 가지 기준을 설정합니다.
이는 AdGroupCriterion
의 webpage
필드를 사용하여 실행됩니다. 이 webpage
필드는 1~3개의 conditions
를 허용하는 WebpageInfo
객체로 설정됩니다.
이러한 conditions
는 이전에 캠페인 설정에서 지정한 도메인 내에서 필터링하거나 검색할 항목을 정확하게 지정할 수 있는 WebpageConditionInfo
인스턴스입니다. 도메인 내에서 필터링할 수 있는 항목은 다음 5가지입니다.
WebpageConditionOperand | 설명 |
---|---|
URL |
페이지의 부분 URL과 일치하는 문자열입니다. |
CATEGORY |
정확하게 일치시킬 카테고리가 포함된 문자열입니다. |
PAGE_TITLE |
부분 페이지 제목과 일치하는 문자열입니다. |
PAGE_CONTENT |
색인이 생성된 지정된 페이지 내의 일부 콘텐츠와 일치하는 문자열입니다. |
CUSTOM_LABEL |
웹페이지 맞춤 라벨 타겟팅 조건과 일치하는 문자열입니다. 맞춤 라벨을 사용하여 페이지 피드 URL 타겟팅을 참고하세요. |
예를 들어 공유숙박 사이트의 /children
브랜치에 있는 모든 항목 (URL
조건)을 타겟팅하지만 제목에 '특별 이벤트'가 포함된 페이지만 타겟팅하는 웹페이지 기준을 만들 수 있습니다 (PAGE_TITLE
조건).
사이트 카테고리 탐색
GAQL 쿼리에서 domain_category
리소스의 필드를 선택하여 Google에서 사이트에 적용된다고 생각하는 DomainCategory
목록을 검색하고 필터링할 수 있습니다.
다음 GAQL 쿼리는 특정 사이트 및 특정 캠페인의 도메인 카테고리 목록을 가져와 ID를 기준으로 필터링합니다.
SELECT
domain_category.category,
domain_category.language_code,
domain_category.recommended_cpc_bid_micros
FROM domain_category
WHERE domain_category.domain = 'example.com'
AND campaign.id = campaign_id
사이트 일부 제외
AdGroupCriterionService
를 사용하여 제외 웹페이지 기준을 설정할 수도 있습니다. 예를 들어 다른 캠페인 또는 광고 그룹으로 관리하려는 특정 제목이 있는 페이지를 제외하는 데 사용할 수 있습니다.
기타 기준
DSA 캠페인 및 광고 그룹은 웹페이지 기준으로만 제한되지 않습니다. 다른 기준 유형을 계속 사용하여 광고의 품질을 더욱 세분화하고 개선할 수 있습니다. 하지만 추가 기준을 너무 많이 사용하면 DSA의 자동 타겟팅 효과가 떨어질 수 있으므로 주의해서 사용해야 합니다.