安全で信頼できる広告エコシステムをユーザーに提供し、新しい規制を遵守するため、Google は広告主様に 1 つまたは複数の適格性確認プログラムを完了するよう要請することがあります。
適格性確認プログラムの完了が求められる場合、適格性確認プロセスの期限が設定されることがあります。期限までに確認が完了しなかった場合、アカウントが一時停止される可能性があります。
必須ではないものの、事前に検証を行うこともできます。IdentityVerificationService
には、次の操作を行うためのメソッドが用意されています。
- お客様のアカウントの確認プロセスのステータス(期限を含む)を取得する
- 確認プロセスを開始する
確認ステータスを取得する
お客様のアカウントの広告主様の身元確認プロセスのステータスを取得するには、GetIdentityVerification
メソッドを呼び出します。
Java
private IdentityVerification getIdentityVerification( long customerId, IdentityVerificationServiceClient identityVerificationServiceClient) { GetIdentityVerificationResponse response = identityVerificationServiceClient.getIdentityVerification(Long.toString(customerId)); if (response.getIdentityVerificationCount() == 0) { return null; } IdentityVerification identityVerification = response.getIdentityVerification(0); String deadline = identityVerification .getIdentityVerificationRequirement() .getVerificationCompletionDeadlineTime(); IdentityVerificationProgress progress = identityVerification.getVerificationProgress(); System.out.printf( "Account %d has a verification completion deadline of '%s' and status '%s' for advertiser" + " identity verification.%n", customerId, deadline, progress.getProgramStatus()); return identityVerification; }
C#
private static IdentityVerification GetIdentityVerification( GoogleAdsClient client, long customerId) { IdentityVerificationServiceClient identityVerificationService = client.GetService(Services.V18.IdentityVerificationService); try { GetIdentityVerificationResponse response = identityVerificationService.GetIdentityVerification( new GetIdentityVerificationRequest() { CustomerId = customerId.ToString() } ); if (response.IdentityVerification.Count == 0) { return null; } IdentityVerification identityVerification = response.IdentityVerification[0]; string deadline = identityVerification.IdentityVerificationRequirement.VerificationCompletionDeadlineTime; IdentityVerificationProgress identityVerificationProgress = identityVerification.VerificationProgress; Console.WriteLine($"Account {customerId} has a verification completion " + $"deadline of {deadline} and status " + $"{identityVerificationProgress.ProgramStatus} for advertiser identity " + "verification."); return identityVerification; } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
private static function getIdentityVerification( int $customerId, IdentityVerificationServiceClient $identityVerificationServiceClient ) { // Gets an identity verification response. $response = $identityVerificationServiceClient->getIdentityVerification( GetIdentityVerificationRequest::build($customerId) ); if (empty($response->getIdentityVerification())) { return null; } // Prints some details about the retrieved identity verification. /** @var IdentityVerification $identityVerification */ $identityVerification = $response->getIdentityVerification()->getIterator()->current(); $deadline = $identityVerification->getIdentityVerificationRequirement() ->getVerificationCompletionDeadlineTime(); $progress = $identityVerification->getVerificationProgress(); printf( "Account %d has a verification completion deadline of '%s' and status '%s' for" . " advertiser identity verification.%s", $customerId, $deadline, IdentityVerificationProgramStatus::name($progress->getProgramStatus()), PHP_EOL ); return $identityVerification; }
Python
def get_identity_verification(client, customer_id): """Retrieves the status of the advertiser identity verification process. Args: client: An initialized GoogleAdsClient instance. customer_id: The client customer ID str. Returns: either an IdentityVerification instance, or None """ service = client.get_service("IdentityVerificationService") response = service.get_identity_verification(customer_id=customer_id) # Check if the response contains any indentity verifications. If not, then # None will be returned. if response.identity_verification: identity_verification = response.identity_verification[0] deadline = ( identity_verification.identity_verification_requirement.verification_completion_deadline_time ) progress = identity_verification.verification_progress.program_status print( f"Account {customer_id} has a verification completion deadline " f"of {deadline} and status {progress} for advertiser identity " "verification." ) return identity_verification
Ruby
def get_identity_verification(client, customer_id) response = client.service.identity_verification.get_identity_verification( customer_id: customer_id ) return nil if response.nil? || response.identity_verification.empty? identity_verification = response.identity_verification.first deadline = identity_verification. identity_verification_requirement. verification_completion_deadline_time progress = identity_verification.verification_progress puts "Account #{customer_id} has a verification completion deadline " \ "of #{deadline} and status #{progress.program_status} for advertiser " \ "identity verification." identity_verification end
Perl
sub get_identity_verification { my ($api_client, $customer_id) = @_; my $response = $api_client->IdentityVerificationService()->get({ customerId => $customer_id }); if (!defined $response->{identityVerification}) { printf "Account %s does not require advertiser identity verification.", $customer_id; return; } my $identity_verification = $response->{identityVerification}[0]; my $deadline = $identity_verification->{identityVerificationRequirement} {verificationCompletionDeadlineTime}; my $identity_verification_progress = $identity_verification->{verificationProgress}; printf "Account %s has a verification completion deadline of %s and status " . "%s for advertiser identity verification.", $customer_id, $deadline, $identity_verification_progress->{programStatus}; return $identity_verification; }
お客様のアカウントが必須の広告主 ID 確認プログラムに登録されている場合、サービスは IdentityVerification
オブジェクトのリストを含む空でないレスポンスを返します。レスポンスが空の場合は、お客様のアカウントで広告主様の身元確認を行う必要がないことを意味します。
Google Ads API は ADVERTISER_IDENTITY_VERIFICATION
プログラムのみをサポートしているため、リストに表示される項目は ADVERTISER_IDENTITY_VERIFICATION
のみです。
IdentityVerification
オブジェクトには次のプロパティが含まれています。
確認プロセスの開始と完了の期限を示す
IdentityVerificationRequirement
確認プロセスの現在のステータスを示す
IdentityVerificationProgress
。ユーザーが確認プロセスを完了するためのアクション URL も含めることができます。
確認処理を開始
お客様のアカウントが必須の広告主様の身元確認プログラムに登録されている場合(GetIdentityVerification
が、確認プロセスの完了期限を含む空でないレスポンスを返した場合)、StartIdentityVerification
を呼び出して確認セッションを開始できます。
Java
private void startIdentityVerification( long customerId, IdentityVerificationServiceClient identityVerificationServiceClient) { // Sends a request to start the identity verification process. identityVerificationServiceClient.startIdentityVerification( Long.toString(customerId), IdentityVerificationProgram.ADVERTISER_IDENTITY_VERIFICATION); }
C#
private static void StartIdentityVerification(GoogleAdsClient client, long customerId) { IdentityVerificationServiceClient identityVerificationService = client.GetService(Services.V18.IdentityVerificationService); StartIdentityVerificationRequest request = new StartIdentityVerificationRequest() { CustomerId = customerId.ToString(), VerificationProgram = IdentityVerificationProgram.AdvertiserIdentityVerification }; try { identityVerificationService.StartIdentityVerification(request); } catch (GoogleAdsException e) { Console.WriteLine("Failure:"); Console.WriteLine($"Message: {e.Message}"); Console.WriteLine($"Failure: {e.Failure}"); Console.WriteLine($"Request ID: {e.RequestId}"); throw; } }
PHP
private static function startIdentityVerification( int $customerId, IdentityVerificationServiceClient $identityVerificationServiceClient ): void { // Sends a request to start the identity verification process. $identityVerificationServiceClient->startIdentityVerification( StartIdentityVerificationRequest::build( $customerId, IdentityVerificationProgram::ADVERTISER_IDENTITY_VERIFICATION ) ); }
Python
def start_identity_verification(client, customer_id): """Starts the identity verification process. Args: client: An initialized GoogleAdsClient instance. customer_id: The client customer ID str. """ service = client.get_service("IdentityVerificationService") # Sends a request to start the identity verification process. service.start_identity_verification( customer_id=customer_id, verification_program=client.enums.IdentityVerificationProgramEnum.ADVERTISER_IDENTITY_VERIFICATION, )
Ruby
def start_identity_verification(client, customer_id) client.service.identity_verification.start_identity_verification( customer_id: customer_id, verification_program: :ADVERTISER_IDENTITY_VERIFICATION, ) end
Perl
sub start_identity_verification { my ($api_client, $customer_id) = @_; my $request = Google::Ads::GoogleAds::V18::Services::IdentityVerificationService::StartIdentityVerificationRequest ->new({ customerId => $customer_id, verificationProgram => ADVERTISER_IDENTITY_VERIFICATION }); $api_client->AdvertiserIdentityVerificationService() ->start_identity_verification($request); }
確認セッションが進行中でない場合にのみ成功します。確認セッションを開始すると、その後の GetIdentityVerification
の呼び出しで、ユーザーが確認プロセスを完了するためのアクション URL と、アクション URL の有効期限が返されます。
有効期限が切れた後、StartIdentityVerification
を再度呼び出して新しい検証セッションを開始できます。