विज्ञापन दिखने से जुड़ी क्वेरी और अमान्य ट्रैफ़िक मेट्रिक

खास जानकारी

यहां दिए गए निर्देशों में, एपीआई का इस्तेमाल करके मान्य विज्ञापन दिखने से जुड़े आंकड़ों और अमान्य ट्रैफ़िक के लिए क्वेरी करने के तरीके के उदाहरण दिए गए हैं. ये मेट्रिक, Google Ads, Display &Video 360, और YouTube Reserve का इस्तेमाल करके खरीदी गई इन्वेंट्री के लिए ही उपलब्ध हैं.

ध्यान दें कि MRC से मान्यता मिली TrueView व्यू की मेट्रिक के लिए, ADH API का इस्तेमाल करना ज़रूरी है. ऐसा इसलिए, क्योंकि इससे जुड़ी कोई टेंप्लेट वाली क्वेरी उपलब्ध नहीं है. इसके अलावा, TrueView व्यू की मेट्रिक को, विज्ञापन दिखने से जुड़ी मेट्रिक के साथ भ्रमित नहीं करना चाहिए.

वह प्लैटफ़ॉर्म चुनें जिसके लिए आपको विज्ञापन दिखने से जुड़ी मेट्रिक के लिए क्वेरी करनी है:

यूज़र इंटरफ़ेस (यूआई) का इस्तेमाल करके, विज्ञापन दिखने से जुड़ी मेट्रिक के लिए क्वेरी करना

विज्ञापन दिखने से जुड़ी टेंप्लेट वाली क्वेरी, MRC से मान्यता मिली मेट्रिक उपलब्ध कराती है.

MRC से मान्यता मिलने या न मिलने का फ़ैसला, बाइनरी होता है. इसका मतलब है कि आपके नतीजों को मान्यता मिल सकती है या नहीं भी मिल सकती है. यह फ़ैसला, नतीजों की पूरी टेबल पर लागू होता है. BigQuery में, MRC से मान्यता मिले सभी नतीजों पर लेबल adh-mrc-accredited लागू होता है. अपनी मेट्रिक को MRC से मान्यता दिलाने के लिए, आपको टेंप्लेट के ज़रिए क्वेरी चलानी होगी.

टेंप्लेट के ज़रिए, MRC से मान्यता मिली क्वेरी चलाने के लिए:

  1. क्वेरी बनाने के तरीके से जुड़े निर्देशों का पालन करें. साथ ही, पक्का करें कि आपने प्लैटफ़ॉर्म के तौर पर Google Ads और क्वेरी टेंप्लेट के तौर पर वीडियो विज्ञापन दिखने से जुड़े आंकड़े को चुना हो.
  2. टेंप्लेट का इस्तेमाल करें के बगल में मौजूद चलाएं बटन पर क्लिक करें.
campaign IDs

एपीआई का इस्तेमाल करके, अमान्य ट्रैफ़िक और विज्ञापन दिखने से जुड़ी मेट्रिक के लिए क्वेरी करना

generateIvtReport और startAnalysis एंडपॉइंट का इस्तेमाल करके, ADH API से अमान्य ट्रैफ़िक और विज्ञापन दिखने से जुड़ी मेट्रिक को वापस पाया जा सकता है. अमान्य ट्रैफ़िक के लिए, adh-mrc-accredited लेबल लागू करने और अपनी मेट्रिक को MRC से मान्यता दिलाने के लिए, आपको generateIvtReport के ज़रिए अपनी मेट्रिक वापस पानी होंगी. इसी तरह, MRC से मान्यता पाने के लिए, ADH API के ज़रिए विज्ञापन दिखने से जुड़ी मेट्रिक के लिए, यहां बताई गई ग्लोबल क्वेरी का इस्तेमाल करना होगा. इस सेक्शन में, Python क्लाइंट लाइब्रेरी का इस्तेमाल करके, इस एंडपॉइंट पर अनुरोध भेजने का तरीका बताया गया है.

एपीआई के क्विकस्टार्ट में दिए गए सेटअप और अनुमति/पुष्टि से जुड़े निर्देशों का पालन करें.

अपने खाते से जुड़ी जानकारी के साथ, यहां दिए गए फ़ील्ड को बदलने के बाद, अपने Google Ads कैंपेन के लिए अमान्य ट्रैफ़िक की रिपोर्ट पाने के लिए, नीचे दी गई क्वेरी चलाई जा सकती है:

  • क्लाइंट सीक्रेट की फ़ाइल
  • ग्राहक आईडी
  • एपीआई पासकोड
  • Campaign IDs
  • समय क्षेत्र

सैंपल कोड

अमान्य ट्रैफ़िक

from __future__ import print_function
import json
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build

# If modifying these scopes, delete the file `token.json`.
SCOPES = ['https://www.googleapis.com/auth/adsdatahub']
TOKEN_FILE = 'token.json'

creds = None

# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists(TOKEN_FILE):
    creds = Credentials.from_authorized_user_file(TOKEN_FILE, SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
    if creds and creds.expired and creds.refresh_token:
        creds.refresh(Request())
    else:
        flow = InstalledAppFlow.from_client_secrets_file(
            'YOUR_CLIENT_SECRETS.json', SCOPES)
        creds = flow.run_local_server(port=0)
    # Save the credentials for the next run.
    with open(TOKEN_FILE, 'w') as token:
        token.write(creds.to_json())

service = build('adsdatahub', 'v1', credentials=creds,
                developerKey='YOUR_API_KEY',
                discoveryServiceUrl='https://adsdatahub.googleapis.com/$discovery/rest?version=v1&labels=')

body = {
    'ads_data_customer_id': YOUR_CUSTOMER_ID,
    'start_date': {
        'year': 2019,
        'month': 12,
        'day': 15
    },
    'end_date': {
        'year': 2019,
        'month': 12,
        'day': 20
    },
    'time_zone': 'YOUR_TIMEZONE',
    'google_ads_dimensions': {
        'campaign_ids': [YOUR_CAMPAIGN_IDS],
        'metric_type': 'METRIC_TYPE_IMPRESSION'
    },
    'dest_table': 'YOUR_DESTINATION_TABLE'
}

resp = service.customers().generateIvtReport(name='customers/YOUR_CUSTOMER_ID,
                                             body=body).execute()
print(json.dumps(resp))

विज्ञापन दिखने से जुड़ी मेट्रिक

from __future__ import print_function
import json
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build

# If modifying these scopes, delete the file `token.json`.
SCOPES = ['https://www.googleapis.com/auth/adsdatahub']
TOKEN_FILE = 'token.json'

creds = None

# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists(TOKEN_FILE):
    creds = Credentials.from_authorized_user_file(TOKEN_FILE, SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
    if creds and creds.expired and creds.refresh_token:
        creds.refresh(Request())
    else:
        flow = InstalledAppFlow.from_client_secrets_file(
            'YOUR_CLIENT_SECRETS.json', SCOPES)
        creds = flow.run_local_server(port=0)
    # Save the credentials for the next run.
    with open(TOKEN_FILE, 'w') as token:
        token.write(creds.to_json())

service = build('adsdatahub', 'v1', credentials=creds,
                developerKey='YOUR_API_KEY',
                discoveryServiceUrl='https://adsdatahub.googleapis.com/$discovery/rest?version=v1&labels=')

name = 'customers/global/analysisQueries/f41320e7296d49158e572aba662f35b1'
body = {
  'spec': {
    'ads_data_customer_id': YOUR_CUSTOMER_ID,
    'start_date': {
      'year': 2019,
      'month': 12,
      'day': 15
    },
    'end_date': {
      'year': 2019,
      'month': 12,
      'day': 20
    },
    'time_zone': 'YOUR_TIMEZONE',
    'parameter_values': {
      'campaign_ids': {
        'array_value': {
          'values': [
            {
              'value': 'YOUR_CAMPAIGN_ID'
            },
          ]
        }
      }
    }
  },
  'dest_table': 'YOUR_DESTINATION_TABLE',
  'customer_id': YOUR_CUSTOMER_ID
}

resp = service.customers().analysisQueries().start(name=name,body=body).execute()
print(json.dumps(resp))

आसानी से पहचान में आने वाले अमान्य ट्रैफ़िक को छोड़कर, विज्ञापन दिखने से जुड़ी मेट्रिक का हिसाब लगाना

आसानी से पहचान में आने वाले अमान्य ट्रैफ़िक (जीआईवीटी) को छोड़कर, MRC से मान्यता मिली विज्ञापन दिखने से जुड़ी मेट्रिक पाने के लिए, इन फ़ॉर्मूलों का इस्तेमाल करें:

  • कुल इंप्रेशन (जीआईवीटी को छोड़कर): कुल इंप्रेशन - आसानी से पहचान में आने वाले अमान्य इंप्रेशन
  • दिखने वाले इंप्रेशन (जीआईवीटी को छोड़कर): दिखने वाले इंप्रेशन + दिखने वाले अमान्य इंप्रेशन - जीआईवीटी से मिले दिखने वाले इंप्रेशन
  • मेज़र किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर): मेज़र किए जा सकने वाले इंप्रेशन + मेज़र किए जा सकने वाले अमान्य इंप्रेशन - जीआईवीटी से मिले मेज़र किए जा सकने वाले इंप्रेशन
  • पात्र इंप्रेशन (जीआईवीटी को छोड़कर): पात्र इंप्रेशन + अमान्य पात्र इंप्रेशन - जीआईवीटी से मिले पात्र इंप्रेशन
  • न दिखने वाले इंप्रेशन (जीआईवीटी को छोड़कर) : मेज़र किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर) - दिखने वाले इंप्रेशन (जीआईवीटी को छोड़कर)
  • मेज़र न किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर): पात्र इंप्रेशन (जीआईवीटी को छोड़कर) - मेज़र किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर)
  • मेज़र किए जा सकने वाले इंप्रेशन का प्रतिशत (जीआईवीटी को छोड़कर): मेज़र किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर) / पात्र इंप्रेशन (जीआईवीटी को छोड़कर)
  • दिखने वाले इंप्रेशन का प्रतिशत (जीआईवीटी को छोड़कर): दिखने वाले इंप्रेशन (जीआईवीटी को छोड़कर) / मेज़र किए जा सकने वाले इंप्रेशन (जीआईवीटी को छोड़कर)