تایید هویت تبلیغ کننده

برای ارائه یک اکوسیستم تبلیغاتی ایمن و قابل اعتماد برای کاربران و پیروی از مقررات در حال ظهور، Google اکنون از تبلیغ‌کنندگان می‌خواهد که یک یا چند برنامه راستی‌آزمایی را تکمیل کنند.

اگر از شما خواسته می شود یک برنامه تأیید را تکمیل کنید، ممکن است یک مهلت برای فرآیند تأیید تعیین شود. اگر مهلت بدون تکمیل تأیید به پایان برسد، حساب شما ممکن است متوقف شود.

شما همچنین می توانید به طور فعال بدون نیاز به انجام این کار، تأیید را انجام دهید. IdentityVerificationService روش هایی را برای انجام موارد زیر ارائه می دهد:

  • وضعیت فرآیند تأیید حساب مشتری، از جمله هر مهلتی را بازیابی کنید
  • یک فرآیند تأیید را شروع کنید

وضعیت تأیید را بازیابی کنید

برای بازیابی وضعیت فرآیند تأیید هویت تبلیغ‌کننده برای حساب مشتری، با روش GetIdentityVerification تماس بگیرید:

جاوا

This example is not yet available in Java; you can take a look at the other languages.
    

سی شارپ

private static IdentityVerification GetIdentityVerification(
        GoogleAdsClient client, long customerId)
{
    IdentityVerificationServiceClient identityVerificationService =
        client.GetService(Services.V16.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

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

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
      

پرل

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;
}
      

اگر حساب مشتری در برنامه راستی‌آزمایی هویت تبلیغ‌کننده اجباری ثبت شده باشد، این سرویس یک پاسخ غیرخالی حاوی فهرستی از اشیاء IdentityVerification برمی‌گرداند. پاسخ خالی نشان می‌دهد که حساب مشتری نیازی به تأیید هویت تبلیغ‌کننده ندارد.

از نسخه ۱۶، Google Ads API فقط از برنامه ADVERTISER_IDENTITY_VERIFICATION پشتیبانی می‌کند، بنابراین این تنها مورد در لیست خواهد بود.

یک شی IdentityVerification دارای ویژگی های زیر است:

  • یک IdentityVerificationRequirement که مهلت‌های شروع و تکمیل فرآیند تأیید را توصیف می‌کند.

  • یک IdentityVerificationProgress که وضعیت فعلی فرآیند تأیید را توصیف می‌کند: این نشانی اینترنتی همچنین می‌تواند شامل URL عملی برای تکمیل فرآیند تأیید توسط کاربر باشد.

فرآیند تأیید را شروع کنید

اگر یک حساب مشتری در برنامه اجباری تأیید هویت تبلیغ‌کننده ثبت‌شده باشد — GetIdentityVerification پاسخی غیرخالی با مهلتی برای تکمیل فرآیند تأیید ارائه کرد، می‌توانید با تماس با StartIdentityVerification جلسه تأیید را شروع کنید:

جاوا

This example is not yet available in Java; you can take a look at the other languages.
    

سی شارپ

private static void StartIdentityVerification(GoogleAdsClient client, long customerId)
{
    IdentityVerificationServiceClient identityVerificationService =
        client.GetService(Services.V16.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

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

def start_identity_verification(client, customer_id)
  client.service.identity_verification.start_identity_verification(
    customer_id: customer_id,
    verification_program: :ADVERTISER_IDENTITY_VERIFICATION,
  )
end
      

پرل

sub start_identity_verification {
  my ($api_client, $customer_id) = @_;

  my $request =
    Google::Ads::GoogleAds::V16::Services::IdentityVerificationService::StartIdentityVerificationRequest
    ->new({
      customerId          => $customer_id,
      verificationProgram => ADVERTISER_IDENTITY_VERIFICATION
    });

  $api_client->AdvertiserIdentityVerificationService()
    ->start_identity_verification($request);
}
      

این فقط در صورتی موفق خواهد شد که جلسه تأیید دیگری در حال انجام نباشد. هنگامی که یک جلسه تأیید را شروع کردید، تماس‌های بعدی به GetIdentityVerification نشانی وب اقدام را به کاربر برمی‌گرداند تا فرآیند تأیید و زمان انقضای URL اقدام را تکمیل کند.

پس از سپری شدن زمان انقضا، می توانید دوباره با StartIdentityVerification تماس بگیرید تا یک جلسه تأیید جدید شروع شود.