コンバージョンを記録するには、Google 広告のコンバージョン アカウントでコンバージョン トラッキングを有効にする必要があります。このガイドでは、コンバージョン トラッキングが有効になっているかどうかを確認する方法、有効になっていない場合に有効にする方法、既存のコンバージョン アクションに関する情報を取得する方法について詳しく説明します。
また、コンバージョンの多くの種類では、コンバージョン トラッカーの作成以外にも事前の準備が必要となります。さまざまなコンバージョン アクションの種類とその 要件について詳しくは、コンバージョン アクションを作成するをご覧ください。
同意を提供する準備をする
コンバージョン データを Google と共有する権限があることを確認することが重要です。次の 2 つの方法があります。
- アカウント単位のデフォルトの同意設定を構成します。 [Google 広告の管理画面]で、 [ツール] -> [データ マネージャー] -> [同意設定] -> [デフォルトの同意設定] をクリックします。
- インポートした各コンバージョンで ClickConversion.consent フィールドを設定します。
コンバージョンをトラッキングするようにウェブサイトを設定する
オフライン コンバージョンのインポートの統合を開始する場合は、まず、 リードの拡張コンバージョン向けに Google タグを設定する の手順に沿って、リードの拡張コンバージョンをトラッキングするようにウェブサイトを設定します。Google タグ マネージャーを使用してウェブサイトを設定することもできます。その場合は、 リードの拡張コンバージョン向けに Google タグ マネージャーを設定する の手順に沿って設定します。
Google 広告のコンバージョン アカウントでコンバージョン トラッキングを有効にする
コンバージョン トラッキングの設定に関する情報を取得する
アカウントのコンバージョン トラッキングの設定を確認し、コンバージョン
トラッキングが有効になっていることを確認するには、Customer リソース
に対して ConversionTrackingSetting をクエリします。
GoogleAdsService.SearchStream を使用して次のクエリを発行します。
SELECT
customer.conversion_tracking_setting.google_ads_conversion_customer,
customer.conversion_tracking_setting.conversion_tracking_status,
customer.conversion_tracking_setting.conversion_tracking_id,
customer.conversion_tracking_setting.cross_account_conversion_tracking_id
FROM customer
google_ads_conversion_customer フィールドは、この顧客のコンバージョンを作成して管理する Google
広告アカウントを示します。クロスアカウント コンバージョン トラッキングを使用している顧客の場合、これは MCC アカウントの ID です。コンバージョンを作成して管理する Google Ads API リクエストでは、Google 広告のコンバージョン顧客 ID を customer_id として指定する必要があります。このフィールドは、コンバージョン
トラッキングが有効になっていない場合でも入力されます。
The
conversion_tracking_status
フィールドは、コンバージョン トラッキングが有効になっているかどうか、アカウント
がクロスアカウント コンバージョン トラッキングを使用しているかどうかを示します。
Google 広告のコンバージョン アカウントの顧客でコンバージョン アクションを作成する
conversion_tracking_status の値が NOT_CONVERSION_TRACKED の場合、アカウントでコンバージョン トラッキングが有効になっていません。次の例のように、Google 広告のコンバージョン アカウントで 1 つ以上の ConversionAction を作成して、コンバージョン トラッキングを有効にします。または、有効にするコンバージョン タイプについて、ヘルプセンターの手順に沿って、管理画面でコンバージョン アクションを作成することもできます。
拡張コンバージョンは、Google 広告 API を介して送信されると自動的に有効になりますが、Google 広告の管理画面から無効にできます。
サンプルコード
Java
private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a ConversionAction. ConversionAction conversionAction = ConversionAction.newBuilder() // Note that conversion action names must be unique. If a conversion action already // exists with the specified conversion_action_name the create operation will fail with // a ConversionActionError.DUPLICATE_NAME error. .setName("Earth to Mars Cruises Conversion #" + getPrintableDateTime()) .setCategory(ConversionActionCategory.DEFAULT) .setType(ConversionActionType.WEBPAGE) .setStatus(ConversionActionStatus.ENABLED) .setViewThroughLookbackWindowDays(15L) .setValueSettings( ValueSettings.newBuilder() .setDefaultValue(23.41) .setAlwaysUseDefaultValue(true) .build()) .build(); // Creates the operation. ConversionActionOperation operation = ConversionActionOperation.newBuilder().setCreate(conversionAction).build(); try (ConversionActionServiceClient conversionActionServiceClient = googleAdsClient.getLatestVersion().createConversionActionServiceClient()) { MutateConversionActionsResponse response = conversionActionServiceClient.mutateConversionActions( Long.toString(customerId), Collections.singletonList(operation)); System.out.printf("Added %d conversion actions:%n", response.getResultsCount()); for (MutateConversionActionResult result : response.getResultsList()) { System.out.printf( "New conversion action added with resource name: '%s'%n", result.getResourceName()); } } }
C#
public void Run(GoogleAdsClient client, long customerId) { // Get the ConversionActionService. ConversionActionServiceClient conversionActionService = client.GetService(Services.V24.ConversionActionService); // Note that conversion action names must be unique. // If a conversion action already exists with the specified name the create operation // will fail with a ConversionAction.DUPLICATE_NAME error. string ConversionActionName = "Earth to Mars Cruises Conversion #" + ExampleUtilities.GetRandomString(); // Add a conversion action. ConversionAction conversionAction = new ConversionAction() { Name = ConversionActionName, Category = ConversionActionCategory.Default, Type = ConversionActionType.Webpage, Status = ConversionActionStatus.Enabled, ViewThroughLookbackWindowDays = 15, ValueSettings = new ConversionAction.Types.ValueSettings() { DefaultValue = 23.41, AlwaysUseDefaultValue = true } }; // Create the operation. ConversionActionOperation operation = new ConversionActionOperation() { Create = conversionAction }; try { // Create the conversion action. MutateConversionActionsResponse response = conversionActionService.MutateConversionActions(customerId.ToString(), new ConversionActionOperation[] { operation }); // Display the results. foreach (MutateConversionActionResult newConversionAction in response.Results) { Console.WriteLine($"New conversion action with resource name = " + $"'{newConversionAction.ResourceName}' was added."); } } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId) { // Creates a conversion action. $conversionAction = new ConversionAction([ // Note that conversion action names must be unique. // If a conversion action already exists with the specified conversion_action_name // the create operation will fail with a ConversionActionError.DUPLICATE_NAME error. 'name' => 'Earth to Mars Cruises Conversion #' . Helper::getPrintableDatetime(), 'category' => ConversionActionCategory::PBDEFAULT, 'type' => ConversionActionType::WEBPAGE, 'status' => ConversionActionStatus::ENABLED, 'view_through_lookback_window_days' => 15, 'value_settings' => new ValueSettings([ 'default_value' => 23.41, 'always_use_default_value' => true ]) ]); // Creates a conversion action operation. $conversionActionOperation = new ConversionActionOperation(); $conversionActionOperation->setCreate($conversionAction); // Issues a mutate request to add the conversion action. $conversionActionServiceClient = $googleAdsClient->getConversionActionServiceClient(); $response = $conversionActionServiceClient->mutateConversionActions( MutateConversionActionsRequest::build($customerId, [$conversionActionOperation]) ); printf("Added %d conversion actions:%s", $response->getResults()->count(), PHP_EOL); foreach ($response->getResults() as $addedConversionAction) { /** @var ConversionAction $addedConversionAction */ printf( "New conversion action added with resource name: '%s'%s", $addedConversionAction->getResourceName(), PHP_EOL ); } }
Python
def main(client: GoogleAdsClient, customer_id: str) -> None: conversion_action_service: ConversionActionServiceClient = ( client.get_service("ConversionActionService") ) # Create the operation. conversion_action_operation: ConversionActionOperation = client.get_type( "ConversionActionOperation" ) # Create conversion action. conversion_action: ConversionAction = conversion_action_operation.create # Note that conversion action names must be unique. If a conversion action # already exists with the specified conversion_action_name, the create # operation will fail with a ConversionActionError.DUPLICATE_NAME error. conversion_action.name = f"Earth to Mars Cruises Conversion {uuid.uuid4()}" conversion_action.type_ = ( client.enums.ConversionActionTypeEnum.UPLOAD_CLICKS ) conversion_action.category = ( client.enums.ConversionActionCategoryEnum.DEFAULT ) conversion_action.status = client.enums.ConversionActionStatusEnum.ENABLED conversion_action.view_through_lookback_window_days = 15 # Create a value settings object. value_settings: ConversionAction.ValueSettings = ( conversion_action.value_settings ) value_settings.default_value = 15.0 value_settings.always_use_default_value = True # Add the conversion action. conversion_action_response: MutateConversionActionsResponse = ( conversion_action_service.mutate_conversion_actions( customer_id=customer_id, operations=[conversion_action_operation], ) ) print( "Created conversion action " f'"{conversion_action_response.results[0].resource_name}".' )
Ruby
def add_conversion_action(customer_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new # Add a conversion action. conversion_action = client.resource.conversion_action do |ca| ca.name = "Earth to Mars Cruises Conversion #{(Time.new.to_f * 100).to_i}" ca.type = :UPLOAD_CLICKS ca.category = :DEFAULT ca.status = :ENABLED ca.view_through_lookback_window_days = 15 # Create a value settings object. ca.value_settings = client.resource.value_settings do |vs| vs.default_value = 15 vs.always_use_default_value = true end end # Create the operation. conversion_action_operation = client.operation.create_resource.conversion_action(conversion_action) # Add the ad group ad. response = client.service.conversion_action.mutate_conversion_actions( customer_id: customer_id, operations: [conversion_action_operation], ) puts "New conversion action with resource name = #{response.results.first.resource_name}." end
Perl
sub add_conversion_action { my ($api_client, $customer_id) = @_; # Note that conversion action names must be unique. # If a conversion action already exists with the specified conversion_action_name, # the create operation fails with error ConversionActionError.DUPLICATE_NAME. my $conversion_action_name = "Earth to Mars Cruises Conversion #" . uniqid(); # Create a conversion action. my $conversion_action = Google::Ads::GoogleAds::V24::Resources::ConversionAction->new({ name => $conversion_action_name, category => DEFAULT, type => WEBPAGE, status => ENABLED, viewThroughLookbackWindowDays => 15, valueSettings => Google::Ads::GoogleAds::V24::Resources::ValueSettings->new({ defaultValue => 23.41, alwaysUseDefaultValue => "true" })}); # Create a conversion action operation. my $conversion_action_operation = Google::Ads::GoogleAds::V24::Services::ConversionActionService::ConversionActionOperation ->new({create => $conversion_action}); # Add the conversion action. my $conversion_actions_response = $api_client->ConversionActionService()->mutate({ customerId => $customer_id, operations => [$conversion_action_operation]}); printf "New conversion action added with resource name: '%s'.\n", $conversion_actions_response->{results}[0]{resourceName}; return 1; }
curl
conversion_action_type が正しい
ConversionActionType 値に設定されていることを確認します。
Google Ads API でのコンバージョン アクションの作成について詳しくは、コンバージョン アクションを作成するをご覧ください。
既存のコンバージョン アクションを取得する
次のクエリを発行すると、既存のコンバージョン アクションの詳細を取得できます。リクエストの顧客 ID が、上記で特定した Google 広告の
コンバージョン アカウントの顧客に設定され、コンバージョン アクションのタイプが
正しい
ConversionActionType
値に設定されていることを確認します。
SELECT
conversion_action.resource_name,
conversion_action.name,
conversion_action.status
FROM conversion_action
WHERE conversion_action.type = 'INSERT_CONVERSION_ACTION_TYPE'
クロスアカウント コンバージョン トラッキング
クロスアカウント コンバージョン トラッキングを使用している場合、cross-account conversion
tracking、the
ConversionActionService は次のコンバージョン アクションを返します。
- クロスアカウント コンバージョン トラッキング用のアカウントで使用される MCC アカウントによって定義されたすべてのコンバージョン アクション
- データが発生したコンバージョン アクションすべて。これには、システム定義のアクションや、MCC アカウントが管理するアクション(その後リンクが解除された場合も含む)が含まれます。
- 顧客が自身のアカウントで定義したすべてのアクション
- リンクされた Google アナリティクス プロパティで作成されたアナリティクスのコンバージョン。
これには、Google 広告にインポートされていないアナリティクスのコンバージョン(ステータスが
HIDDEN)のアクションが含まれます。
Google 広告 API を使用すると、クライアント アカウントの作成時にクロスアカウント コンバージョン トラッキングを有効にできます。
新しい Customer を作成するときは、
conversion_tracking_setting.google_ads_conversion_customer
を、クライアント アカウントに代わってコンバージョン アクションを管理する MCC アカウントの
リソース名に設定します。
この MCC アカウントは、新しいクライアント アカウントの create リクエストを発行するアカウントでもあります。
v20 以降では、
Google 広告 API を使用して、クライアント アカウントの作成時と更新時の両方でクロスアカウント コンバージョン トラッキングを有効にできます。
既存のクライアント アカウントを更新する場合は、クロスアカウント
コンバージョン トラッキングを有効にするには、
conversion_tracking_setting.google_ads_conversion_customer
フィールドを設定します。このフィールドは、クライアント アカウントに代わってコンバージョン アクションを管理する
MCC アカウントのリソース名に設定する必要があります。
この MCC アカウントは、クライアント アカウントの update リクエストを発行するアカウントでもあります。
注: Google 広告 API を使用してクライアント アカウントのクロスアカウント コンバージョン トラッキングの設定を変更することは、許可リストに登録されたユーザーのみが利用できる機能です。使用する際は、アカウント マネージャーにお問い合わせください。
- クライアント アカウントは、新しいコンバージョン トラッキング マネージャーのデフォルトのコンバージョン値のルールと、デフォルトの顧客ライフサイクル目標を採用します。
- 特定のコンバージョン アクションをターゲットとするキャンペーンは、コンバージョン マネージャー アカウントのデフォルトのコンバージョン目標を使用するように切り替わります。特定のコンバージョン アクションが引き続きターゲットとして設定されていると、MCC アカウントがクライアント アカウントと同じ目標ではない可能性があるため、一貫性のない動作が発生する可能性があります。キャンペーンが適切な目標に向けて最適化されていることを確認してください。
- 1 つのアカウントが複数の MCC アカウントに属する場合、1 つの MCC アカウントのコンバージョン アクションのみを使用できます。コンバージョン トラッキング アカウントが指定されていない場合、アカウントはデフォルトで自身をコンバージョン トラッキング アカウントとして使用します。
コンバージョン アクションを作成する
コンバージョンを測定するには、トラッキングするコンバージョン アクションの
typeの
に対応する
ConversionActionを設定します。たとえば、オンライン購入と電話問い合わせとでは、使用するコンバージョン アクションが異なります。
API で新しいコンバージョン アクションを設定する場合は、以下の
コンバージョン アクションを追加するコードサンプルを使用することをおすすめします。このサンプルは、すべてのバックグラウンド認証タスクを処理し、
a ConversionActionを作成する方法を説明します。
また、コンバージョンの多くの種類では、コンバージョン トラッカーの作成以外にも事前の準備が必要となります。たとえば、ウェブサイトでのコンバージョンをトラッキングするには、コード スニペットと呼ばれるタグ をウェブサイトのコンバージョン ページに追加する必要があります。他の コンバージョン アクションの種類の詳細な要件については、弊社 ヘルプセンターの記事をご覧ください。
サンプルコード
次のコード例では、新しいコンバージョン アクションを作成する手順について説明します。具体的には、
type が
UPLOAD_CLICKS に設定されたコンバージョン アクションを作成します。
また、category
を DEFAULTに設定します。
次のデフォルト設定が適用されます。
Google Ads API は
primary_for_goalフィールド を自動的に設定しますが、このフィールドを明示的に設定して、 コンバージョン アクションがアカウントのレポート作成と入札に与える影響をコンバージョン目標と 組み合わせた場合に制御できます。Google Ads API は
counting_typeを自動的に toMANY_PER_CLICKに設定します。詳しくは、 コンバージョンのカウント方法について をご覧ください。Google Ads API は、アトリビューション モデルを データ ドリブンに設定します。これを行うには、
attribution_model_settingsフィールドをGOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVEN値に設定します。この値はAttributionModelのものです。 アトリビューション モデルについて詳しくは、こちらのヘルプセンター記事 をご覧ください。
Java
private void runExample(GoogleAdsClient googleAdsClient, long customerId) { // Creates a ConversionAction. ConversionAction conversionAction = ConversionAction.newBuilder() // Note that conversion action names must be unique. If a conversion action already // exists with the specified conversion_action_name the create operation will fail with // a ConversionActionError.DUPLICATE_NAME error. .setName("Earth to Mars Cruises Conversion #" + getPrintableDateTime()) .setCategory(ConversionActionCategory.DEFAULT) .setType(ConversionActionType.WEBPAGE) .setStatus(ConversionActionStatus.ENABLED) .setViewThroughLookbackWindowDays(15L) .setValueSettings( ValueSettings.newBuilder() .setDefaultValue(23.41) .setAlwaysUseDefaultValue(true) .build()) .build(); // Creates the operation. ConversionActionOperation operation = ConversionActionOperation.newBuilder().setCreate(conversionAction).build(); try (ConversionActionServiceClient conversionActionServiceClient = googleAdsClient.getLatestVersion().createConversionActionServiceClient()) { MutateConversionActionsResponse response = conversionActionServiceClient.mutateConversionActions( Long.toString(customerId), Collections.singletonList(operation)); System.out.printf("Added %d conversion actions:%n", response.getResultsCount()); for (MutateConversionActionResult result : response.getResultsList()) { System.out.printf( "New conversion action added with resource name: '%s'%n", result.getResourceName()); } } }
C#
public void Run(GoogleAdsClient client, long customerId) { // Get the ConversionActionService. ConversionActionServiceClient conversionActionService = client.GetService(Services.V24.ConversionActionService); // Note that conversion action names must be unique. // If a conversion action already exists with the specified name the create operation // will fail with a ConversionAction.DUPLICATE_NAME error. string ConversionActionName = "Earth to Mars Cruises Conversion #" + ExampleUtilities.GetRandomString(); // Add a conversion action. ConversionAction conversionAction = new ConversionAction() { Name = ConversionActionName, Category = ConversionActionCategory.Default, Type = ConversionActionType.Webpage, Status = ConversionActionStatus.Enabled, ViewThroughLookbackWindowDays = 15, ValueSettings = new ConversionAction.Types.ValueSettings() { DefaultValue = 23.41, AlwaysUseDefaultValue = true } }; // Create the operation. ConversionActionOperation operation = new ConversionActionOperation() { Create = conversionAction }; try { // Create the conversion action. MutateConversionActionsResponse response = conversionActionService.MutateConversionActions(customerId.ToString(), new ConversionActionOperation[] { operation }); // Display the results. foreach (MutateConversionActionResult newConversionAction in response.Results) { Console.WriteLine($"New conversion action with resource name = " + $"'{newConversionAction.ResourceName}' was added."); } } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId) { // Creates a conversion action. $conversionAction = new ConversionAction([ // Note that conversion action names must be unique. // If a conversion action already exists with the specified conversion_action_name // the create operation will fail with a ConversionActionError.DUPLICATE_NAME error. 'name' => 'Earth to Mars Cruises Conversion #' . Helper::getPrintableDatetime(), 'category' => ConversionActionCategory::PBDEFAULT, 'type' => ConversionActionType::WEBPAGE, 'status' => ConversionActionStatus::ENABLED, 'view_through_lookback_window_days' => 15, 'value_settings' => new ValueSettings([ 'default_value' => 23.41, 'always_use_default_value' => true ]) ]); // Creates a conversion action operation. $conversionActionOperation = new ConversionActionOperation(); $conversionActionOperation->setCreate($conversionAction); // Issues a mutate request to add the conversion action. $conversionActionServiceClient = $googleAdsClient->getConversionActionServiceClient(); $response = $conversionActionServiceClient->mutateConversionActions( MutateConversionActionsRequest::build($customerId, [$conversionActionOperation]) ); printf("Added %d conversion actions:%s", $response->getResults()->count(), PHP_EOL); foreach ($response->getResults() as $addedConversionAction) { /** @var ConversionAction $addedConversionAction */ printf( "New conversion action added with resource name: '%s'%s", $addedConversionAction->getResourceName(), PHP_EOL ); } }
Python
def main(client: GoogleAdsClient, customer_id: str) -> None: conversion_action_service: ConversionActionServiceClient = ( client.get_service("ConversionActionService") ) # Create the operation. conversion_action_operation: ConversionActionOperation = client.get_type( "ConversionActionOperation" ) # Create conversion action. conversion_action: ConversionAction = conversion_action_operation.create # Note that conversion action names must be unique. If a conversion action # already exists with the specified conversion_action_name, the create # operation will fail with a ConversionActionError.DUPLICATE_NAME error. conversion_action.name = f"Earth to Mars Cruises Conversion {uuid.uuid4()}" conversion_action.type_ = ( client.enums.ConversionActionTypeEnum.UPLOAD_CLICKS ) conversion_action.category = ( client.enums.ConversionActionCategoryEnum.DEFAULT ) conversion_action.status = client.enums.ConversionActionStatusEnum.ENABLED conversion_action.view_through_lookback_window_days = 15 # Create a value settings object. value_settings: ConversionAction.ValueSettings = ( conversion_action.value_settings ) value_settings.default_value = 15.0 value_settings.always_use_default_value = True # Add the conversion action. conversion_action_response: MutateConversionActionsResponse = ( conversion_action_service.mutate_conversion_actions( customer_id=customer_id, operations=[conversion_action_operation], ) ) print( "Created conversion action " f'"{conversion_action_response.results[0].resource_name}".' )
Ruby
def add_conversion_action(customer_id) # GoogleAdsClient will read a config file from # ENV['HOME']/google_ads_config.rb when called without parameters client = Google::Ads::GoogleAds::GoogleAdsClient.new # Add a conversion action. conversion_action = client.resource.conversion_action do |ca| ca.name = "Earth to Mars Cruises Conversion #{(Time.new.to_f * 100).to_i}" ca.type = :UPLOAD_CLICKS ca.category = :DEFAULT ca.status = :ENABLED ca.view_through_lookback_window_days = 15 # Create a value settings object. ca.value_settings = client.resource.value_settings do |vs| vs.default_value = 15 vs.always_use_default_value = true end end # Create the operation. conversion_action_operation = client.operation.create_resource.conversion_action(conversion_action) # Add the ad group ad. response = client.service.conversion_action.mutate_conversion_actions( customer_id: customer_id, operations: [conversion_action_operation], ) puts "New conversion action with resource name = #{response.results.first.resource_name}." end
Perl
sub add_conversion_action { my ($api_client, $customer_id) = @_; # Note that conversion action names must be unique. # If a conversion action already exists with the specified conversion_action_name, # the create operation fails with error ConversionActionError.DUPLICATE_NAME. my $conversion_action_name = "Earth to Mars Cruises Conversion #" . uniqid(); # Create a conversion action. my $conversion_action = Google::Ads::GoogleAds::V24::Resources::ConversionAction->new({ name => $conversion_action_name, category => DEFAULT, type => WEBPAGE, status => ENABLED, viewThroughLookbackWindowDays => 15, valueSettings => Google::Ads::GoogleAds::V24::Resources::ValueSettings->new({ defaultValue => 23.41, alwaysUseDefaultValue => "true" })}); # Create a conversion action operation. my $conversion_action_operation = Google::Ads::GoogleAds::V24::Services::ConversionActionService::ConversionActionOperation ->new({create => $conversion_action}); # Add the conversion action. my $conversion_actions_response = $api_client->ConversionActionService()->mutate({ customerId => $customer_id, operations => [$conversion_action_operation]}); printf "New conversion action added with resource name: '%s'.\n", $conversion_actions_response->{results}[0]{resourceName}; return 1; }
curl
この例は、クライアント ライブラリの [リマーケティング] フォルダと、コード例のコレクション(コンバージョン アクションのコード例を追加する)で確認できます。
検証
Google 広告と Google 広告 API はさまざまなコンバージョン アクションをサポートしているため、一部の
検証ルールはtype
によって異なります。
コンバージョン アクションを作成する際に最もよく発生するエラーは
DUPLICATE_NAMEです。
各コンバージョン アクションに一意の名前を使用してください。
ConversionAction フィールドの設定に関するヒントをいくつかご紹介します。
- すべての enum フィールド
- enum フィールドを
UNKNOWNに設定しようとすると、RequestError.INVALID_ENUM_VALUEエラーが発生します。 app_id- The
app_id属性は不変であり、新しい アプリ コンバージョンを作成するときにのみ設定できます。 attribution_model_settings- これを非推奨の
オプションに
設定すると、
CANNOT_SET_RULE_BASED_ATTRIBUTION_MODELSエラーが発生します。Google 広告では、GOOGLE_ADS_LAST_CLICKとGOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVENのみがサポートされています。 click_through_lookback_window_daysこの属性を許容範囲外の値に設定すると、
RangeError.TOO_LOWまたはRangeError.TOO_HIGHエラーが発生します。AD_CALLまたはWEBSITE_CALLコンバージョン アクションの場合、この属性は[1,60]の範囲内にする必要があります。他のほとんどのコンバージョン アクションの場合、許容範囲は[1,30]です。include_in_conversions_metriccreateオペレーションまたはupdateオペレーションでこの値を設定すると、FieldError.IMMUTABLE_FIELDエラーが発生して失敗します。代わりに、primary_for_goalを コンバージョン目標ガイドの説明に沿って設定します。phone_call_duration_seconds通話用ではないコンバージョン アクションでこの属性を設定しようとすると、
FieldError.VALUE_MUST_BE_UNSETエラーが発生します。typetype属性は不変であり、新しいコンバージョンを作成するときにのみ設定できます。typeがUNKNOWNのコンバージョン アクションを更新すると、MutateError.MUTATE_NOT_ALLOWEDエラーが発生します。value_settingsWEBSITE_CALLまたはAD_CALLコンバージョン アクションのvalue_settingsでは、always_use_default_valueをtrueに設定する必要があります。この値の作成時または更新時にfalseの値を指定すると、INVALID_VALUEエラーが発生します。view_through_lookback_window_daysこの属性を許容範囲外の値に設定すると、
RangeError.TOO_LOWまたはRangeError.TOO_HIGHエラーが発生します。ほとんどのコンバージョン アクションの場合、許容範囲は[1,30]です。この属性は、
AD_CALLまたはWEBSITE_CALLコンバージョン アクションでは設定できません。値を指定すると、VALUE_MUST_BE_UNSETエラーが発生します。