रिसॉर्स टारगेटिंग को मैनेज करना, Display & Video 360 API की मुख्य सुविधा है. टारगेटिंग को कई तरह के संसाधनों के लिए असाइन किया जा सकता है. साथ ही, यह कई अन्य संसाधनों और आईडी स्पेस का इस्तेमाल करती है. इस पेज पर, Display & Video 360 एपीआई असाइन की गई टारगेटिंग के विकल्पों की सेवाओं को अपनाने के दौरान ध्यान में रखने वाली सीमाओं और सबसे सही तरीकों के बारे में बताया गया है.
टारगेटिंग इनहेरिटेंस का इस्तेमाल करना
कुछ संसाधनों को असाइन की गई टारगेटिंग, उनके चाइल्ड संसाधनों को इनहेरिट की जा सकती है. चाइल्ड रिसॉर्स से इनहेरिट किए गए टारगेटिंग विकल्पों को वापस पाया जा सकता है. हालांकि, चाइल्ड रिसॉर्स लेवल पर उनमें बदलाव नहीं किया जा सकता. इससे, ब्रैंड सुरक्षा सेटिंग और अन्य टारगेटिंग को पार्टनर या विज्ञापन देने वाले व्यक्ति या कंपनी के पूरे खाते पर लागू किया जा सकता है.
इनहेरिटेंस का पाथ, नीचे दिए गए डायग्राम में देखा जा सकता है:
डायग्राम में बताया गया है कि कुछ टारगेटिंग लेवल, सिर्फ़ टारगेटिंग टाइप के सबसेट के साथ काम करते हैं. इसका मतलब है कि कुछ टारगेटिंग विकल्पों को ऊपर के लेवल पर सेट नहीं किया जा सकता और इनहेरिट नहीं किया जा सकता. इसके बजाय, इन्हें निचले लेवल पर सेट करना होगा.
YouTube और Partners के संसाधनों में इनहेरिटेंस
Display & Video 360 API में, YouTube और पार्टनर के संसाधनों के लिए टारगेटिंग इनहेरिटेंस नहीं दिखता. विज्ञापन ग्रुप से इनहेरिट की गई टारगेटिंग को AdGroup
लेवल पर वापस नहीं पाया जा सकेगा. साथ ही, पैरंट रिसॉर्स के लिए असाइन की गई YouTube टारगेटिंग को चाइल्ड रिसॉर्स से इनहेरिट नहीं किया जाएगा.
किसी विज्ञापन ग्रुप के लिए, फ़ंक्शनल टारगेटिंग की सभी सेटिंग वापस पाने के लिए, आपको विज्ञापन ग्रुप, पैरंट लाइन आइटम, और पैरंट विज्ञापन देने वाले के लिए असाइन किए गए टारगेटिंग विकल्प वापस पाने होंगे.
लाइन आइटम बनाते समय असाइन की गई टारगेटिंग के बारे में जानकारी
इनहेरिट की गई टारगेटिंग के विकल्पों के अलावा, ज़्यादातर टारगेटिंग को सिर्फ़ लाइन आइटम बनाने के बाद असाइन किया जा सकता है. हालांकि, कुछ टाइप की टारगेटिंग में, लाइन आइटम बनाते समय लाइन आइटम को असाइन की गई वैल्यू का डिफ़ॉल्ट सबसेट होता है. टारगेटिंग के ये टाइप हैं:
मौजूदा टारगेटिंग विकल्प बनाने या असाइन किए गए ऐसे विकल्पों को मिटाने की कोशिश करने पर, गड़बड़ी का मैसेज दिखता है. इसलिए, हमारा सुझाव है कि आप टारगेटिंग के उस पूरे सुइट के बारे में जानें जो आपके लाइन आइटम बनाने के बाद असाइन किया जाता है. अगर आपको टारगेटिंग के सभी टाइप में, किसी लाइन आइटम को असाइन की गई टारगेटिंग वापस लानी है, तो advertisers.lineItems.bulkListAssignedTargetingOptions
का इस्तेमाल करें.
इसके अलावा, जब किसी टाइप का कोई टारगेटिंग विकल्प, संसाधन को असाइन नहीं किया जाता है, तो कुछ सेटिंग डिफ़ॉल्ट रूप से सेट हो जाती हैं. उदाहरण के लिए, अगर किसी संसाधन के लिए TARGETING_TYPE_AUTHORIZED_SELLER_STATUS
टारगेटिंग का कोई विकल्प तय नहीं किया गया है, तो इसका मतलब है कि वह "अनुमति पा चुके डायरेक्ट सेलर और रीसेलर" स्टेटस का इस्तेमाल कर रहा है.
अपने-आप "डिफ़ॉल्ट टारगेटिंग" की सुविधा मिलने की उम्मीद न करें
Display & Video 360 में, कैंपेन या इंसर्शन ऑर्डर के लेवल पर सेट की गई टारगेटिंग, तुरंत अपने चाइल्ड लाइन आइटम पर लागू नहीं होती. इस टारगेटिंग को "डिफ़ॉल्ट टारगेटिंग" कहा जाता है. इसका इस्तेमाल, टारगेटिंग टेंप्लेट के तौर पर किया जाता है. इसे यूज़र इंटरफ़ेस (यूआई) में बनाए गए लाइन आइटम पर लागू किया जाता है.
Display & Video 360 API में, डिफ़ॉल्ट टारगेटिंग, नए बनाए गए लाइन आइटम पर अपने-आप लागू नहीं होती. बुनियादी लाइन आइटम बनाने पर, कैंपेन या इंसर्शन ऑर्डर लेवल की टारगेटिंग कॉपी नहीं होती. इस मामले में, टारगेटिंग को लाइन आइटम पर अलग से लागू किया जाना चाहिए. इसके लिए, टारगेटिंग के लिए असाइन किए गए विकल्प बनाएं या एक साथ कई बदलाव करें तरीकों का इस्तेमाल करें.
हालांकि, कुछ खास तरीके अपवाद हो सकते हैं. उदाहरण के लिए, advertisers.lineItems.generateDefault
की मदद से बनाए गए लाइन आइटम, अपने पैरंट इंसर्शन ऑर्डर की सेटिंग कॉपी करते हैं. इनमें असाइन की गई टारगेटिंग भी शामिल है.
इसी तरह, डुप्लीकेट बनाने की सुविधा से बनाए गए लाइन आइटम को, ओरिजनल लाइन आइटम जैसी ही टारगेटिंग असाइन की जाएगी.
YouTube और पार्टनर टारगेटिंग में बदलाव नहीं किया जा सकता
खास तौर पर YouTube और पार्टनर कैंपेन के लिए टारगेटिंग को, Display & Video 360 API का इस्तेमाल करके अपडेट नहीं किया जा सकता.
YouTube और पार्टनर टारगेटिंग में, सीधे तौर पर YouTube और पार्टनर के लाइन आइटम और विज्ञापन ग्रुप को असाइन की गई सभी टारगेटिंग शामिल होती है. साथ ही, इन टारगेटिंग टाइप की कोई भी टारगेटिंग भी शामिल होती है:
TARGETING_TYPE_SESSION_POSITION
TARGETING_TYPE_YOUTUBE_CHANNEL
TARGETING_TYPE_YOUTUBE_VIDEO
इस टारगेटिंग को सीधे Display & Video 360 यूज़र इंटरफ़ेस (यूआई) का इस्तेमाल करके या स्ट्रक्चर्ड डेटा फ़ाइल अपलोड करके अपडेट किया जा सकता है.
एक ही विकल्प की मदद से ऑडियंस टारगेटिंग असाइन करना
टारगेटिंग के ज़्यादातर टाइप के लिए, टारगेटिंग के विकल्प अलग-अलग असाइन किए जाते हैं. ऑडियंस ग्रुप टारगेटिंग, इस मॉड्यूलर कन्वेंशन का पालन नहीं करती. इसके बजाय, इसे एक ऐसे ऑडियंस ग्रुप टारगेटिंग की जानकारी ऑब्जेक्ट में असाइन किया जाता है जिसे कॉन्फ़िगर किया जा सकता है. इसमें विज्ञापन दिखाते समय शामिल और बाहर रखने के लिए, ऑडियंस के आईडी की सूची होती है. इस ऑडियंस ग्रुप विकल्प के लिए, assignedTargetingOptionId
को असाइन करने के बाद, यह हमेशा "audienceGroup" होता है.
इस डिज़ाइन का मतलब है कि ऑडियंस ग्रुप टारगेटिंग में कोई भी बदलाव करने के लिए, सबसे पहले ऑडियंस ग्रुप के लिए असाइन किया गया टारगेटिंग विकल्प मिटाया जाना चाहिए. इसके बाद, अपनी पसंद के मुताबिक बदलावों के साथ, ऑडियंस ग्रुप टारगेटिंग का नया विकल्प बनाया जाना चाहिए. 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
advertisers.lineItems.bulkUpdate
advertisers.lineItems.patch
advertisers.lineItems.targetingTypes.assignedTargetingOptions.create
advertisers.lineItems.targetingTypes.assignedTargetingOptions.delete
अगर आपको एक ही लाइन आइटम के लिए, एक साथ कई असाइन किए गए टारगेटिंग विकल्प जोड़ने या हटाने हैं, तो आपको एक ही advertisers.lineItems.bulkEditAssignedTargetingOptions
अनुरोध का इस्तेमाल करना चाहिए. अगर आपको किसी लाइन आइटम की सेटिंग और टारगेटिंग अपडेट करनी है, तो patch
या bulkUpdate
अनुरोध और काम की टारगेटिंग के अनुरोध को सूची में जोड़ें. इससे यह पक्का किया जा सकेगा कि जब तक पहला अनुरोध जवाब नहीं देता, तब तक दूसरा अनुरोध न भेजा जाए.