टारगेटिंग

संसाधन टारगेटिंग का मैनेजमेंट, Display & Video 360 API की एक मुख्य सुविधा है. टारगेटिंग को कई तरह के संसाधनों को असाइन किया जा सकता है. साथ ही, कई दूसरे संसाधनों और आईडी स्पेस का इस्तेमाल करता है. इस पेज पर Display & Video 360 API की ओर से असाइन की गई टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) विकल्प सेवाओं को अपनाने के दौरान लागू किए जाने वाले सबसे सही तरीकों और तरीकों की जानकारी दी गई है.

टारगेटिंग इनहेरिटेंस का इस्तेमाल करें

कुछ संसाधनों को असाइन की गई टारगेटिंग, उनके चाइल्ड संसाधनों से इनहेरिट की जा सकती है. चाइल्ड रिसॉर्स से इनहेरिट किए गए टारगेटिंग विकल्प फिर से हासिल किए जा सकते हैं. हालांकि, चाइल्ड रिसॉर्स लेवल पर उनमें बदलाव नहीं किया जा सकता. इससे ब्रैंड सुरक्षा सेटिंग और अन्य टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) को, पूरी तरह से पार्टनर या विज्ञापन देने वाले पर लागू किया जा सकता है.

नीचे दिए गए डायग्राम में इनहेरिटेंस का पाथ देखा जा सकता है:

टारगेटिंग इनहेरिटेंस डायग्राम

जैसा कि डायग्राम में बताया गया है, टारगेटिंग के कुछ लेवल, टारगेटिंग के सिर्फ़ एक सबसेट के साथ काम करते हैं. इसका मतलब है कि टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) के कुछ विकल्प ऊपर के लेवल पर सेट नहीं किए जा सकते और इनहेरिट किए गए नहीं हो सकते, बल्कि उन्हें निचले लेवल पर सेट करना पड़ता है.

YouTube और पार्टनर के संसाधनों को इनहेरिट करना

YouTube और पार्टनर के संसाधनों के लिए Display & Video 360 API में टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) इनहेरिटेंस नहीं दिखती है. विज्ञापन ग्रुप से इनहेरिट की गई टारगेटिंग को AdGroup लेवल पर फिर से हासिल नहीं किया जा सकेगा. साथ ही, पैरंट संसाधनों को असाइन की गई YouTube टारगेटिंग, चाइल्ड संसाधनों से इनहेरिट नहीं की जाएगी.

किसी विज्ञापन ग्रुप की सभी फ़ंक्शनल टारगेटिंग सेटिंग को फिर से पाने के लिए, आपको विज्ञापन ग्रुप, पैरंट लाइन आइटम, और पैरंट विज्ञापन देने वाले के लिए असाइन किए गए टारगेटिंग विकल्प फिर से पाने होंगे.

लाइन आइटम बनाने के समय असाइन की गई टारगेटिंग का ध्यान रखें

इनहेरिट किए गए टारगेटिंग विकल्पों के अलावा, ज़्यादातर टारगेटिंग को लाइन आइटम बनाने के बाद ही असाइन किया जा सकता है. हालांकि, कुछ टारगेटिंग टाइप ऐसे होते हैं जिनमें लाइन आइटम बनाते समय, लाइन आइटम को असाइन की गई वैल्यू का डिफ़ॉल्ट सबसेट होता है. वे टारगेटिंग के ये टाइप हैं:

मौजूदा या असाइन नहीं किए गए टारगेटिंग विकल्प बनाने या हटाने की कोशिश करने पर एक गड़बड़ी दिखती है. इसलिए, हमारा सुझाव है कि आप उस पूरे टारगेटिंग सुइट की जानकारी रखें जिसे बनाए जाने के दौरान आपके लाइन आइटम को असाइन किया गया है. अगर आपको सभी टारगेटिंग टाइप में, किसी लाइन आइटम को असाइन किए गए टारगेटिंग को फिर से पाना है, तो advertisers.lineItems.bulkListAssignedTargetingOptions का इस्तेमाल करें.

इसके अलावा, कुछ सेटिंग डिफ़ॉल्ट रूप से तब सेट होती हैं, जब संसाधन को उस टाइप का कोई टारगेटिंग विकल्प असाइन नहीं किया जाता. उदाहरण के लिए, अगर किसी संसाधन में, TARGETING_TYPE_AUTHORIZED_SELLER_STATUS टारगेटिंग का विकल्प नहीं दिया गया है, तो इसका मतलब है कि वह "अनुमति पा चुके डायरेक्ट सेलर और रीसेलर" स्टेटस का इस्तेमाल कर रहा है.

अपने-आप "डिफ़ॉल्ट टारगेटिंग" की उम्मीद न करें

Display & Video 360 में, कैंपेन या इंसर्शन ऑर्डर लेवल पर सेट की गई टारगेटिंग, उनके चाइल्ड लाइन आइटम को तुरंत पास नहीं की जाती. इस टारगेटिंग को "डिफ़ॉल्ट टारगेटिंग" के नाम से जाना जाता है. इसका इस्तेमाल टारगेटिंग टेंप्लेट के तौर पर किया जाता है. इसे यूज़र इंटरफ़ेस (यूआई) में बाद में बनाए जाने वाले लाइन आइटम पर लागू किया जाता है.

Display & Video 360 API में, डिफ़ॉल्ट टारगेटिंग, बनाए गए नए लाइन आइटम पर अपने-आप लागू नहीं होती. बुनियादी लाइन आइटम बनाने से किसी कैंपेन या इंसर्ट करने के क्रम के लेवल की टारगेटिंग कॉपी नहीं होती. इस मामले में, मनचाहे टारगेटिंग को असाइन किए गए टारगेटिंग विकल्प बनाएं या एक साथ कई बदलाव करने के तरीकों की मदद से, लाइन आइटम पर अलग से लागू करना होगा.

खास तरीकों को अपवाद माना जा सकता है. उदाहरण के लिए, advertisers.lineItems.generateDefault के ज़रिए बनाए गए लाइन आइटम, अपने पैरंट इंसर्शन ऑर्डर से सेटिंग कॉपी करते हैं. इसमें असाइन की गई टारगेटिंग भी शामिल होती है. इसी तरह, डुप्लीकेट की मदद से बनाए गए लाइन आइटम को वही टारगेटिंग असाइन की जाएगी जो ओरिजनल लाइन आइटम में है.

YouTube और पार्टनर टारगेटिंग में बदलाव नहीं किया जा सकता

Display & Video 360 API का इस्तेमाल करके, खास तौर पर YouTube और पार्टनर कैंपेन के लिए टारगेटिंग को अपडेट नहीं किया जा सकता.

YouTube और पार्टनर टारगेटिंग में वे सभी टारगेटिंग शामिल हैं जो सीधे YouTube और पार्टनर लाइन आइटम और विज्ञापन ग्रुप को असाइन की गई हैं. साथ ही, इसमें नीचे दी गई टारगेटिंग के टाइप की सभी टारगेटिंग शामिल हैं:

  • TARGETING_TYPE_SESSION_POSITION
  • TARGETING_TYPE_YOUTUBE_CHANNEL
  • TARGETING_TYPE_YOUTUBE_VIDEO

यह टारगेटिंग सीधे Display & Video 360 यूज़र इंटरफ़ेस (यूआई) का इस्तेमाल करके या स्ट्रक्चर्ड डेटा फ़ाइल अपलोड करके अपडेट की जा सकती है.

एक ही विकल्प के साथ ऑडियंस टारगेटिंग असाइन करना

टारगेटिंग के ज़्यादातर टाइप के लिए, टारगेटिंग के विकल्प अलग-अलग असाइन किए जाते हैं. ऑडियंस ग्रुप टारगेटिंग इस मॉड्यूलर कन्वेंशन का पालन नहीं करती. हालांकि, इसे एक ही ऑडियंस ग्रुप टारगेटिंग की जानकारी ऑब्जेक्ट में असाइन किया जाता है. इसे कॉन्फ़िगर किया जा सकता है. इसमें विज्ञापन दिखाते समय ऑडियंस को शामिल करने और बाहर रखने के लिए, ऑडियंस के आईडी की सूची होती है. ऑडियंस ग्रुप के इस विकल्प के लिए, assignedTargetingOptionId असाइन किए जाने पर हमेशा "ऑडियंस ग्रुप" होता है.

इस डिज़ाइन का मतलब है कि ऑडियंस ग्रुप की टारगेटिंग में कोई भी बदलाव करने के लिए, पहले उसे असाइन किए गए मौजूदा टारगेटिंग विकल्प को मिटाना होगा. इसके बाद, अपनी ज़रूरत के हिसाब से बदलाव करके, ऑडियंस ग्रुप को टारगेट करने का नया विकल्प बनाना होगा. ऐसा advertisers.lineItems.bulkEditAssignedTargetingOptions का इस्तेमाल करके, एक ही अनुरोध में किया जा सकता है.

यहां ऑडियंस टारगेटिंग को अपडेट करने का उदाहरण दिया गया है, ताकि Google की अन्य ऑडियंस को और बेहतर तरीके से टारगेट किया जा सके:

Java

long advertiserId = advertiser-id;
long lineItemId = line-item-id
List<Long> addedGoogleAudienceIds =
    Arrays.asList(google-audience-id-to-add,...);

// Build Google audience targeting settings objects to add to audience
// targeting.
ArrayList<GoogleAudienceTargetingSetting> newGoogleAudienceSettings =
    new ArrayList<GoogleAudienceTargetingSetting>();

// Convert list of Google Audience IDs into list of settings.
for (Long googleAudienceId : addedGoogleAudienceIds) {
  newGoogleAudienceSettings.add(new GoogleAudienceTargetingSetting()
      .setGoogleAudienceId(googleAudienceId));
}

// Create relevant bulk edit request objects.
BulkEditLineItemAssignedTargetingOptionsRequest requestContent =
    new BulkEditLineItemAssignedTargetingOptionsRequest();
AudienceGroupAssignedTargetingOptionDetails updatedAudienceGroupDetails;
ArrayList<DeleteAssignedTargetingOptionsRequest> audienceGroupDeleteRequests =
    new ArrayList<DeleteAssignedTargetingOptionsRequest>();

try {
  // Retrieve existing audience group targeting.
  AssignedTargetingOption existingAudienceGroupTargetingOption =
      service
          .advertisers()
          .lineItems()
          .targetingTypes()
          .assignedTargetingOptions()
          .get(
              advertiserId,
              lineItemId,
              "TARGETING_TYPE_AUDIENCE_GROUP",
              "audienceGroup"
          ).execute();

  // Extract existing audience group targeting details.
  updatedAudienceGroupDetails =
      existingAudienceGroupTargetingOption.getAudienceGroupDetails();

  // Build and add delete request for existing audience group targeting.
  ArrayList<String> deleteAudienceGroupAssignedTargetingIds =
      new ArrayList<String>();
  deleteAudienceGroupAssignedTargetingIds.add("audienceGroup");

  audienceGroupDeleteRequests
      .add(new DeleteAssignedTargetingOptionsRequest()
          .setTargetingType("TARGETING_TYPE_AUDIENCE_GROUP")
          .setAssignedTargetingOptionIds(
              deleteAudienceGroupAssignedTargetingIds
          )
      );
}
catch (GoogleJsonResponseException e) {
  updatedAudienceGroupDetails =
      new AudienceGroupAssignedTargetingOptionDetails();
}

// Set delete requests in edit request.
requestContent.setDeleteRequests(audienceGroupDeleteRequests);

// Construct new group of Google Audiences to include in targeting.
GoogleAudienceGroup updatedIncludedGoogleAudienceGroup =
    updatedAudienceGroupDetails.getIncludedGoogleAudienceGroup();
if (updatedIncludedGoogleAudienceGroup != null) {
  List<GoogleAudienceTargetingSetting> updatedGoogleAudienceSettings =
      updatedIncludedGoogleAudienceGroup.getSettings();
  updatedGoogleAudienceSettings.addAll(newGoogleAudienceSettings);
  updatedIncludedGoogleAudienceGroup
      .setSettings(updatedGoogleAudienceSettings);
} else {
  updatedIncludedGoogleAudienceGroup = new GoogleAudienceGroup();
  updatedIncludedGoogleAudienceGroup.setSettings(newGoogleAudienceSettings);
}

// Add new Google Audience group to audience group targeting details.
updatedAudienceGroupDetails
    .setIncludedGoogleAudienceGroup(updatedIncludedGoogleAudienceGroup);

// Create new targeting option to assign.
AssignedTargetingOption newAudienceGroupTargeting =
    new AssignedTargetingOption();
newAudienceGroupTargeting
    .setAudienceGroupDetails(updatedAudienceGroupDetails);

// Build audience group targeting create request and add to list of create
// requests.
ArrayList<AssignedTargetingOption> createAudienceGroupAssignedTargetingOptions =
    new ArrayList<AssignedTargetingOption>();
createAudienceGroupAssignedTargetingOptions.add(newAudienceGroupTargeting);
ArrayList<CreateAssignedTargetingOptionsRequest> targetingCreateRequests =
    new ArrayList<CreateAssignedTargetingOptionsRequest>();
targetingCreateRequests.add(new CreateAssignedTargetingOptionsRequest()
    .setTargetingType("TARGETING_TYPE_AUDIENCE_GROUP")
    .setAssignedTargetingOptions(
        createAudienceGroupAssignedTargetingOptions
    )
);

// Set create requests in edit request.
requestContent.setCreateRequests(targetingCreateRequests);

// Configure and execute the bulk list request.
BulkEditLineItemAssignedTargetingOptionsResponse response =
    service.advertisers().lineItems()
        .bulkEditLineItemAssignedTargetingOptions(
            advertiserId,
            lineItemId,
            requestContent).execute();

Python

advertiser_id = advertiser-id
line_item_id = line-item-id
added_google_audiences = [google-audience-id-to-add,...]

# Build Google audience targeting settings objects to create.
new_google_audience_targeting_settings = []
for google_audience_id in added_google_audiences:
 new_google_audience_targeting_settings.append(
     {'googleAudienceId': google_audience_id}
 )

# Retrieve any existing line item audience targeting.
retrieved_audience_targeting = service.advertisers().lineItems(
).targetingTypes().assignedTargetingOptions().get(
   advertiserId=advertiser_id,
   lineItemId=line_item_id,
   targetingType="TARGETING_TYPE_AUDIENCE_GROUP",
   assignedTargetingOptionId="audienceGroup"
).execute()

updated_audience_group_details = {}

# Copy over any existing audience targeting.
if 'audienceGroupDetails' in retrieved_audience_targeting:
 updated_audience_group_details = retrieved_audience_targeting[
     'audienceGroupDetails']

# Append the new Google audience IDs to any existing positive Google
# audience targeting.
if 'includedGoogleAudienceGroup' in updated_audience_group_details:
 updated_audience_group_details[
     'includedGoogleAudienceGroup']['settings'].extend(
         new_google_audience_targeting_settings)
else:
 updated_audience_group_details['includedGoogleAudienceGroup'] = {
     'settings': new_google_audience_targeting_settings
 }

# Build bulk edit request.
bulk_edit_request = {
   'deleteRequests': [
       {
         'targetingType': "TARGETING_TYPE_AUDIENCE_GROUP",
         'assignedTargetingOptionIds': [
           "audienceGroup"
         ]
       }
   ],
   'createRequests': [
       {
           'targetingType': "TARGETING_TYPE_AUDIENCE_GROUP",
           'assignedTargetingOptions': [
               {'audienceGroupDetails': updated_audience_group_details}
           ]
       }
   ]
}

# Update the audience targeting
updated_audience_targeting = service.advertisers().lineItems(
).bulkEditLineItemAssignedTargetingOptions(
   advertiserId=advertiser_id,
   lineItemId=line_item_id,
   body=bulk_edit_request
).execute()

PHP

$advertiserId = advertiser-id;
$lineItemId = line-item-id;
$addedGoogleAudienceIds = array(google-audience-id-to-add,...);

// Convert list of Google Audience IDs into list of Google audience
// settings.
$newGoogleAudienceSettings = array();
foreach ($addedGoogleAudienceIds as $googleAudienceId) {
    $newSetting =
        new Google_Service_DisplayVideo_GoogleAudienceTargetingSetting();
    $newSetting->setGoogleAudienceId($googleAudienceId);
    $newGoogleAudienceSettings[] = $newSetting;
}

// Create a bulk edit request.
$requestBody =
    new Google_Service_DisplayVideo_BulkEditLineItemAssignedTargetingOptionsRequest();

$audienceGroupDeleteRequests = array();

try {
    // Retrieve existing audience group targeting.
    $existingAudienceGroupTargetingOption = $this
        ->service
        ->advertisers_lineItems_targetingTypes_assignedTargetingOptions
        ->get(
            $advertiserId,
            $lineItemId,
            'TARGETING_TYPE_AUDIENCE_GROUP',
            'audienceGroup'
        );

    // Extract existing audience group targeting details.
    $updatedAudienceGroupDetails =
        $existingAudienceGroupTargetingOption
            ->getAudienceGroupDetails();

    // Build and add delete request for existing audience group
    // targeting.
    $deleteAudienceGroupAssignedTargetingIds = array();
    $deleteAudienceGroupAssignedTargetingIds[] = "audienceGroup";

    $audienceGroupDeleteRequest =
        new Google_Service_DisplayVideo_DeleteAssignedTargetingOptionsRequest();
    $audienceGroupDeleteRequest
        ->setTargetingType('TARGETING_TYPE_AUDIENCE_GROUP');
    $audienceGroupDeleteRequest
        ->setAssignedTargetingOptionIds(
            $deleteAudienceGroupAssignedTargetingIds
        );
    $audienceGroupDeleteRequests[] = $audienceGroupDeleteRequest;
} catch (\Exception $e) {
    $updatedAudienceGroupDetails =
        new Google_Service_DisplayVideo_AudienceGroupAssignedTargetingOptionDetails();
}

// Set delete requests in edit request.
$requestBody->setDeleteRequests($audienceGroupDeleteRequests);

// Construct new group of Google audiences to include in targeting.
$updatedIncludedGoogleAudienceGroup = $updatedAudienceGroupDetails
    ->getIncludedGoogleAudienceGroup();

if (!empty($updatedIncludedGoogleAudienceGroup)) {
    // Get existing settings.
    $updatedGoogleAudienceSettings =
    $updatedIncludedGoogleAudienceGroup->getSettings();

    // Add new Google audiences to existing list.
    $updatedGoogleAudienceSettings = array_merge(
        $updatedGoogleAudienceSettings,
        $newGoogleAudienceSettings
    );

    // Set updated Google audience list.
    $updatedIncludedGoogleAudienceGroup
        ->setSettings($updatedGoogleAudienceSettings);
} else {
    // Create new Google audience group.
    $updatedIncludedGoogleAudienceGroup =
        new Google_Service_DisplayVideo_GoogleAudienceGroup();

    // Set list of new Google audiences for targeting.
    $updatedIncludedGoogleAudienceGroup
        ->setSettings($newGoogleAudienceSettings);
}

// Add new Google Audience group to audience group targeting details.
$updatedAudienceGroupDetails
    ->setIncludedGoogleAudienceGroup(
        $updatedIncludedGoogleAudienceGroup
    );

// Create new targeting option to assign.
$newAudienceGroupTargeting =
    new Google_Service_DisplayVideo_AssignedTargetingOption();
$newAudienceGroupTargeting
    ->setAudienceGroupDetails($updatedAudienceGroupDetails);

// Build audience group targeting create request and add to list of
// create requests.
$createAudienceGroupAssignedTargetingOptions = array();
$createAudienceGroupAssignedTargetingOptions[] =
    $newAudienceGroupTargeting;
$createAudienceGroupTargetingRequest =
    new Google_Service_DisplayVideo_CreateAssignedTargetingOptionsRequest();
$createAudienceGroupTargetingRequest->setTargetingType(
    "TARGETING_TYPE_AUDIENCE_GROUP"
);
$createAudienceGroupTargetingRequest->setAssignedTargetingOptions(
    $createAudienceGroupAssignedTargetingOptions
);
$createRequests[] = $createAudienceGroupTargetingRequest;

// Set create requests in edit request.
$requestBody->setCreateRequests($createRequests);

// Call the API, editing the assigned targeting options for the
// identified line item.
$response = $this
    ->service
    ->advertisers_lineItems
    ->bulkEditLineItemAssignedTargetingOptions(
        $advertiserId,
        $lineItemId,
        $requestBody
    );

टारगेटिंग के विकल्पों के बंद होने के लिए तैयार रहें

टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) विकल्प स्थिर नहीं होते और समय-समय पर छोटी संख्या को बंद किया जा सकता है. टारगेटिंग (विज्ञापन के लिए सही दर्शक चुनना) विकल्प बंद होने के बाद, लाइन आइटम के विज्ञापन दिखाने पर कोई असर नहीं पड़ता है. बंद किए जाने के बाद, इन विकल्पों को मौजूदा लाइन आइटम से हटा दिया जाएगा. इससे उन अनुरोधों को हटा दिया जाएगा जो इन विकल्पों को वापस पाने या असाइन करने की कोशिश करेंगे और गड़बड़ियों की वजह से ऐसा होगा.

इन गड़बड़ियों से बचने के लिए, हमारा सुझाव है कि आप सेव किए गए टारगेटिंग विकल्प आईडी की नियमित रूप से जांच करें. हमारा सुझाव है कि कोटा बचाने के लिए, नियमित तौर पर इस्तेमाल होने वाली आईडी कैश मेमोरी में सेव करें. हालांकि, आईडी स्टोर करने का मतलब है कि शायद आपको टारगेटिंग का कोई विकल्प न दिखे. इस वजह से, आपको नियमित रूप से, सभी स्टोर किए गए टारगेटिंग विकल्प आईडी पाने के लिए, targetingOptions.targetingTypes.get का इस्तेमाल करना चाहिए. इससे यह पुष्टि की जा सकेगी कि वे अब भी Display & Video 360 पर काम कर रहे हैं.

पिछले और आने वाले समय में जो सुविधाएं हटा दी गई हैं उनके बारे में ज़्यादा जानने के लिए, बंद होने के एलान पेज पर जाएं.

एक ही लाइन आइटम को अपडेट करने के लिए एक साथ अनुरोध न करें

एक साथ कई अनुरोधों का इस्तेमाल करके किसी एक लाइन आइटम की सेटिंग या असाइन किए गए टारगेटिंग को अपडेट करने पर गड़बड़ी दिखेगी. लागू होने वाले अनुरोधों में शामिल हैं:

अगर आपको एक ही समय में किसी एक लाइन आइटम के लिए, असाइन किए गए कई टारगेटिंग विकल्पों को जोड़ना या हटाना है, तो आपको एक ही advertisers.lineItems.bulkEditAssignedTargetingOptions अनुरोध का इस्तेमाल करना चाहिए. अगर आपको लाइन आइटम की सेटिंग और टारगेटिंग को अपडेट करना है, तो patch या bulkUpdate अनुरोध और इससे जुड़े टारगेटिंग अनुरोध को सूची में जोड़ें. इससे यह पक्का किया जा सकेगा कि दूसरा अनुरोध तब तक न भेजा जाए, जब तक पहला जवाब जवाब न दे.