การมองเห็นโฆษณาของการค้นหาและเมตริกการเข้าชมที่ไม่ถูกต้อง

ภาพรวม

วิธีการด้านล่างแสดงตัวอย่างวิธีค้นหาทั้งการเข้าชมจากการมองเห็นโฆษณาที่ถูกต้องและการเข้าชมที่ไม่ถูกต้องโดยใช้ API เมตริกเหล่านี้ใช้ได้กับพื้นที่โฆษณาที่ซื้อโดยใช้ Google Ads, Display และ วิดีโอ 360 และการจองใน YouTube

โปรดทราบว่าเมตริกการดู TrueView ที่ MRC รับรองต้องใช้ ADH API เนื่องจากไม่มีการค้นหาจากเทมเพลตที่เกี่ยวข้อง นอกจากนี้ เมตริกยอดดู TrueView ไม่ควรสับสนกับเมตริกการมองเห็นโฆษณา

เลือกประตูการซื้อที่คุณต้องการค้นหาเมตริกการมองเห็นโฆษณา ดังนี้

ค้นหาเมตริกการมองเห็นโฆษณาโดยใช้ UI

การค้นหาการมองเห็นโฆษณาที่ใช้เทมเพลตจะแสดงเมตริกที่ MRC รับรอง

การรับรองโดย MRC เป็นแบบไบนารี กล่าวคือ ผลลัพธ์ของคุณจะได้รับการรับรองหรือไม่ก็ได้ และจะใช้กับตารางผลลัพธ์ทั้งหมด ใน BigQuery ป้ายกำกับ adh-mrc-accredited จะใช้กับผลลัพธ์ที่ผ่านการรับรองจาก MRC ทั้งหมด คุณต้องเรียกใช้การค้นหาผ่านเทมเพลตเพื่อให้เมตริกได้รับการรับรองจาก MRC

วิธีเรียกใช้การค้นหาที่ MRC รับรองผ่านเทมเพลต

  1. ทำตามวิธีสร้างคำค้นหา แล้วเลือก YouTube Reserve เป็นประตูการซื้อ และเลือกการมองเห็นโฆษณาวิดีโอเป็นเทมเพลตการค้นหา
  2. คลิกปุ่มเรียกใช้ถัดจากใช้เทมเพลต

ค้นหาเมตริกการเข้าชมและการมองเห็นโฆษณาที่ไม่ถูกต้องโดยใช้ API

คุณดึงเมตริกการเข้าชมและการมองเห็นโฆษณาที่ไม่ถูกต้องได้จาก ADH API โดยใช้ปลายทาง generateIvtReport และ startAnalysis สำหรับการเข้าชมที่ไม่ถูกต้อง คุณต้องดึงเมตริกผ่าน generateIvtReport เพื่อให้ใช้ป้ายกำกับ adh-mrc-accredited และเมตริกของคุณให้เป็นการรับรองจาก MRC ในทำนองเดียวกัน การค้นหาส่วนกลางที่ระบุไว้ด้านล่างต้องใช้สำหรับเมตริกการมองเห็นโฆษณาผ่าน ADH API เพื่อการรับรองของ MRC ส่วนนี้จะครอบคลุมวิธีส่งคำขอไปยังปลายทางนี้โดยใช้ไลบรารีของไคลเอ็นต์ Python

ทำตามคำแนะนำในการตั้งค่าและการให้สิทธิ์/การตรวจสอบสิทธิ์ในการเริ่มต้นใช้งาน API อย่างรวดเร็ว

หลังจากแทนที่ช่องต่อไปนี้ด้วยข้อมูลที่เกี่ยวข้องกับบัญชีแล้ว คุณสามารถเรียกใช้การค้นหาด้านล่างเพื่อดึงรายงานการเข้าชมที่ไม่ถูกต้องของ YouTube Reserve แคมเปญ

  • ไฟล์รหัสลับไคลเอ็นต์
  • รหัสลูกค้า
  • คีย์ API
  • Order 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',
   
'yt_reserve_dimensions': {
       
'order_ids': [YOUR_ORDER_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/ad88e8562a8f4baa9c8522945fe95522'
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': {
     
'line_item_ids': {
       
'array_value': {
         
'values': [
           
{
             
'value': 'YOUR_LINE_ITEM_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 รับรองซึ่งจำนวนสุทธิ การเข้าชมที่ไม่ถูกต้องแบบทั่วไป (GIVT):

  • จำนวนการแสดงผลทั้งหมด (สุทธิของ GIVT): การแสดงผลทั้งหมด - การแสดงผลที่ไม่ถูกต้องทั่วไป
  • การแสดงผลที่มองเห็นได้ (GIVT สุทธิ): การแสดงผลที่มองเห็นได้ + การแสดงผลที่มองเห็นได้ที่ไม่ถูกต้อง - การแสดงผลที่มองเห็นได้ใน GIVT
  • การแสดงผลที่วัดได้ (GIVT สุทธิ): การแสดงผลที่วัดได้ + การแสดงผลที่วัดได้ที่ไม่ถูกต้อง - การแสดงผลที่วัดได้ใน GIVT
  • การแสดงผลที่มีสิทธิ์ (GIVT สุทธิ): การแสดงผลที่มีสิทธิ์ + การแสดงผลที่มีสิทธิ์ที่ไม่ถูกต้อง - การแสดงผลที่มีสิทธิ์ GIVT
  • การแสดงผลที่มองไม่เห็น (GIVT สุทธิ) : การแสดงผลที่วัดได้ (GIVT สุทธิ) - การแสดงผลที่มองเห็นได้ (GIVT สุทธิ)
  • การแสดงผลที่วัดไม่ได้ (GIVT สุทธิ): การแสดงผลที่มีสิทธิ์ (GIVT สุทธิ) - การแสดงผลที่วัดได้ (GIVT สุทธิ)
  • % การแสดงผลที่วัดได้ (GIVT สุทธิ): การแสดงผลที่วัดได้ (GIVT สุทธิ) / การแสดงผลที่มีสิทธิ์ (GIVT สุทธิ)
  • % การแสดงผลที่มองเห็นได้ (GIVT สุทธิ): การแสดงผลที่มองเห็นได้ (GIVT สุทธิ) / การแสดงผลที่วัดได้ (GIVT สุทธิ)