Hạn mức tài khoản

Display & Video 360 có nhiều giới hạn về tài nguyên. Những giới hạn này hiếm khi được tiếp cận, nhưng sẽ gây ra lỗi nếu đạt đến giới hạn.

Sử dụng phương thức audit để lấy một nhóm nhỏ số lượng thực thể trong một nhà quảng cáo. Tránh đạt đến hạn mức trong tài khoản bằng cách thường xuyên kiểm tra nhà quảng cáo.

Sau đây là cách lấy số lượt chuyển đổi của một nhà quảng cáo:

Java

// Provide the ID of the advertiser.
long advertiserId = advertiser-id;

// Define the audit fields to retrieve in a comma-separated string.
String readMask = "usedCampaignsCount,usedInsertionOrdersCount,usedLineItemsCount";

// Get the audit for the advertiser.
AuditAdvertiserResponse auditResponse =
    service.advertisers().audit(advertiserId).setReadMask(readMask).execute();

// Display the audit results.
System.out.printf("Audit for advertiser ID %s:%n", advertiserId);
System.out.printf("Used campaigns: %s%n", auditResponse.getUsedCampaignsCount());
System.out.printf("Used insertion orders: %s%n", auditResponse.getUsedInsertionOrdersCount());
System.out.printf("Used line items: %s", auditResponse.getUsedLineItemsCount());

Python

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

# Define the audit fields to retrieve in a comma-separated string.
read_mask = "usedCampaignsCount,usedInsertionOrdersCount,usedLineItemsCount"

# Generate audit.
audit_response = (
    service.advertisers()
    .audit(advertiserId=advertiser_id, readMask=read_mask)
    .execute()
)

# Print audit results.
print(f"Audit for advertiser ID {advertiser_id}:")
print(f'Used campaigns: {audit_response["usedCampaignsCount"]}')
print(f'Used insertion orders: {audit_response["usedInsertionOrdersCount"]}')
print(f'Used line items: {audit_response["usedLineItemsCount"]}')

PHP

// Provide the ID of the advertiser.
$advertiserId = advertiser-id;

// Define the audit fields to retrieve in a comma-separated string.
$readMask = "usedCampaignsCount,usedInsertionOrdersCount,usedLineItemsCount";

// Configure the API request.
$auditOptParams = array(
    'readMask' => $readMask
);

// Call the API to retrieve account limit counts.
try {
    $auditResponse =
        $this->service->advertisers->audit(
            $advertiserId,
            $auditOptParams
        );
} catch (\Exception $e) {
    $this->renderError($e);
    return;
}

// Print the audit responses.
printf('<p>Audit for advertiser ID %s:</p>', $advertiserId);
printf('<p>Used campaigns: %s</p>', $auditResponse['usedCampaignsCount']);
printf('<p>Used insertion orders: %s</p>', $auditResponse['usedInsertionOrdersCount']);
printf('<p>Used line items: %s</p>', $auditResponse['usedLineItemsCount']);