इस गाइड में, Campaign Manager 360 API Conversions सेवा का इस्तेमाल करके, कन्वर्ज़न में बदलाव करने के बारे में सिलसिलेवार निर्देश दिए गए हैं. आगे बढ़ने से पहले, हमारा सुझाव है कि आप ऑफ़लाइन कन्वर्ज़न के बारे में जानने के लिए, खास जानकारी देखें. साथ ही, इस गाइड में बताए गए कॉन्सेप्ट के बारे में जानें.
शुरू करने से पहले
बदलाव करने के इस वर्कफ़्लो की मदद से, मौजूदा ऑनलाइन और ऑफ़लाइन कन्वर्ज़न के quantity और value में बदलाव किया जा सकता है. ऐसा करने के लिए, आपको ऐसी वैल्यू देनी होंगी जिनसे उन कन्वर्ज़न की खास तौर पर पहचान की जा सके जिनमें बदलाव करना है. जिन कन्वर्ज़न में बदलाव किया जा रहा है उनके टाइप के आधार पर, आपको ये वैल्यू अलग-अलग तरीकों से मिलेंगी:
ऑनलाइन कन्वर्ज़न की पहचान करने के लिए ज़रूरी वैल्यू, डेटा ट्रांसफ़र से मिल सकती हैं.
ऑफ़लाइन कन्वर्ज़न की पहचान करने के लिए ज़रूरी वैल्यू, सफल
batchinsertअनुरोधों केConversionsBatchInsertResponseमें दिखती हैं.
किसी भी तरह के कन्वर्ज़न में बदलाव करने के बाद, ConversionsBatchUpdateResponse में वे वैल्यू शामिल होंगी जो बाद में बदलाव करने के लिए ज़रूरी हैं.
कन्वर्ज़न रिसॉर्स कॉन्फ़िगर करना
बदलाव करने के वर्कफ़्लो के पहले चरण में, एक या उससे ज़्यादा Conversion रिसॉर्स ऑब्जेक्ट बनाना शामिल है.
जिस कन्वर्ज़न में बदलाव करना है उसकी पहचान करने के लिए, इन फ़ील्ड का इस्तेमाल किया जाता है. ये फ़ील्ड भरना ज़रूरी है. साथ ही, इनमें मौजूद जानकारी किसी मौजूदा कन्वर्ज़न से पूरी तरह मैच होनी चाहिए.
| फ़ील्ड | जानकारी |
|---|---|
|
एन्क्रिप्ट यानी सुरक्षित किया गया यूज़र आईडी, Google क्लिक आईडी, डिसप्ले क्लिक आईडी, मेल खाने वाला आईडी या मोबाइल डिवाइस आईडी, जिससे कन्वर्ज़न जनरेट हुआ. |
floodlightActivityId |
वह Floodlight गतिविधि जिसे कन्वर्ज़न एट्रिब्यूट किया गया है. |
floodlightConfigurationId |
तय की गई गतिविधि के लिए इस्तेमाल किया गया Floodlight कॉन्फ़िगरेशन. |
ordinal |
कन्वर्ज़न से जुड़ा डुप्लीकेट कॉपी हटाने वाला आइडेंटिफ़ायर. |
timestampMicros |
कन्वर्ज़न का टाइमस्टैंप, Unix epoch के बाद से माइक्रोसेकंड में. |
जिन फ़ील्ड में बदलाव किया जा सकता है उनकी सूची यहां दी गई है.
ये फ़ील्ड ज़रूरी हैं. इनमें दी गई वैल्यू, बदलाव किए जा रहे कन्वर्ज़न की पहले से मौजूद वैल्यू को बदल देंगी.
| फ़ील्ड | जानकारी |
|---|---|
quantity |
कन्वर्ज़न से जुड़े आइटम की संख्या. |
value |
कन्वर्ज़न से जनरेट होने वाला रेवेन्यू. |
इन फ़ील्ड को भरना ज़रूरी नहीं है. अगर वैल्यू सेट नहीं की जाती है, तो इसमें कोई बदलाव नहीं होगा.
| फ़ील्ड | जानकारी |
|---|---|
customVariables |
कन्वर्ज़न के कस्टम Floodlight वैरिएबल. अगर वैरिएबल सेट है, तो वैल्यू को अपडेट या इंसर्ट किया जाएगा. अगर वैरिएबल की वैल्यू सेट नहीं की जाती है, तो वह नहीं बदलती. |
रेफ़रंस दस्तावेज़ में बताए गए अन्य सभी फ़ील्ड काम नहीं करते और उनमें बदलाव नहीं किया जा सकता. बदलाव के अनुरोध में, काम न करने वाले फ़ील्ड शामिल करने पर गड़बड़ी होगी. अगर बदलाव किए जा रहे कन्वर्ज़न में, काम न करने वाले किसी फ़ील्ड के लिए पहले से मौजूद वैल्यू शामिल हैं, तो वे वैल्यू अपने-आप सुरक्षित हो जाएंगी.
नीचे दिए गए उदाहरण में, बदलाव करने के लिए एक सामान्य कन्वर्ज़न रिसॉर्स ऑब्जेक्ट बनाने का तरीका बताया गया है:
C#
// Find the Floodlight configuration ID based on the provided activity ID. FloodlightActivity floodlightActivity = service.FloodlightActivities.Get(profileId, floodlightActivityId).Execute(); long floodlightConfigurationId = (long) floodlightActivity.FloodlightConfigurationId; // Construct the conversion object with values that identify the conversion to update. Conversion conversion = new Conversion(); conversion.EncryptedUserId = conversionUserId; conversion.FloodlightActivityId = floodlightActivityId; conversion.FloodlightConfigurationId = floodlightConfigurationId; conversion.Ordinal = conversionOrdinal; conversion.TimestampMicros = conversionTimestamp; // Set the fields to be updated. These fields are required; to preserve a value from the // existing conversion, it must be copied over manually. conversion.Quantity = newQuantity; conversion.Value = newValue;
Java
// Create a conversion object populated with values that identify the conversion to update. Conversion conversion = new Conversion(); conversion.setEncryptedUserId(encryptedUserId); conversion.setFloodlightActivityId(floodlightActivityId); conversion.setFloodlightConfigurationId(floodlightConfigurationId); conversion.setOrdinal(ordinal); conversion.setTimestampMicros(timestampMicros); // Set the fields to be updated. These fields are required; to preserve a value from the // existing conversion, it must be copied over manually. conversion.setQuantity(newQuantity); conversion.setValue(newValue);
PHP
// Find Floodlight configuration ID based on provided activity ID. $activity = $this->service->floodlightActivities->get( $values['user_profile_id'], $values['floodlight_activity_id'] ); $floodlightConfigId = $activity->getFloodlightConfigurationId(); // Create a conversion object with values that identify the conversion to // update. $conversion = new Google_Service_Dfareporting_Conversion(); $conversion->setEncryptedUserId($values['encrypted_user_id']); $conversion->setFloodlightActivityId($values['floodlight_activity_id']); $conversion->setFloodlightConfigurationId($floodlightConfigId); $conversion->setOrdinal($values['ordinal']); $conversion->setTimestampMicros($values['timestamp']); // Set the fields to be updated. These fields are required; to preserve a // value from the existing conversion, it must be copied over manually. $conversion->setQuantity($values['new_quantity']); $conversion->setValue($values['new_value']);
Python
# Construct the conversion object with values that identify the conversion # to update. conversion = { 'encryptedUserId': encrypted_user_id, 'floodlightActivityId': floodlight_activity_id, 'floodlightConfigurationId': floodlight_config_id, 'ordinal': ordinal, 'timestampMicros': timestamp } # Set the fields to be updated. These fields are required; to preserve a # value from the existing conversion, it must be copied over manually. conversion['quantity'] = new_quantity conversion['value'] = new_value
Ruby
# Look up the Floodlight configuration ID based on activity ID. floodlight_activity = service.get_floodlight_activity(profile_id, existing_conversion[:floodlight_activity_id]) floodlight_config_id = floodlight_activity.floodlight_configuration_id # Construct the conversion with values that identify the conversion to # update. conversion = DfareportingUtils::API_NAMESPACE::Conversion.new( encrypted_user_id: existing_conversion[:encrypted_user_id], floodlight_activity_id: existing_conversion[:floodlight_activity_id], floodlight_configuration_id: floodlight_config_id, ordinal: existing_conversion[:ordinal], timestamp_micros: existing_conversion[:timestamp] ) # Set the fields to be updated. These fields are required; to preserve a # value from the existing conversion, it must be copied over manually. conversion.quantity = new_quantity conversion.value = new_value
एन्क्रिप्ट (सुरक्षित) करने की जानकारी देना
अगर जिन कन्वर्ज़न में बदलाव किया जा रहा है वे एन्क्रिप्ट (सुरक्षित) किए गए यूज़र आईडी से जुड़े हैं, तो आपको बदलाव के अनुरोध के तहत यह जानकारी देनी होगी कि उन्हें कैसे एन्क्रिप्ट (सुरक्षित) किया गया है. ज़्यादा जानकारी के लिए, कन्वर्ज़न अपलोड करना गाइड देखें.
ज़रूरत पड़ने पर, इन वैल्यू के बारे में बताने वाला EncryptionInfo ऑब्जेक्ट बनाना, बदलाव करने के वर्कफ़्लो का दूसरा चरण है:
C#
// Create the encryption info. EncryptionInfo encryptionInfo = new EncryptionInfo(); encryptionInfo.EncryptionEntityId = encryptionEntityId; encryptionInfo.EncryptionEntityType = encryptionEntityType; encryptionInfo.EncryptionSource = encryptionSource;
Java
// Create the encryption info. EncryptionInfo encryptionInfo = new EncryptionInfo(); encryptionInfo.setEncryptionEntityId(encryptionEntityId); encryptionInfo.setEncryptionEntityType(encryptionEntityType); encryptionInfo.setEncryptionSource(encryptionSource);
PHP
$encryptionInfo = new Google_Service_Dfareporting_EncryptionInfo(); $encryptionInfo->setEncryptionEntityId($values['encryption_entity_id']); $encryptionInfo->setEncryptionEntityType($values['encryption_entity_type']); $encryptionInfo->setEncryptionSource($values['encryption_source']);
Python
# Construct the encryption info. encryption_info = { 'encryptionEntityId': encryption_entity_id, 'encryptionEntityType': encryption_entity_type, 'encryptionSource': encryption_source }
Ruby
# Construct the encryption info. encryption_info = DfareportingUtils::API_NAMESPACE::EncryptionInfo.new( encryption_entity_id: encryption[:entity_id], encryption_entity_type: encryption[:entity_type], encryption_source: encryption[:source] )
अपडेट का अनुरोध जनरेट करना
इस प्रोसेस का आखिरी चरण, batchupdate पर कॉल करके कन्वर्ज़न में बदलाव करना है. यह तरीका, ConversionsBatchUpdateRequest ऑब्जेक्ट को स्वीकार करता है. इसमें, बदलाव किए जाने वाले कन्वर्ज़न के सेट को उनसे जुड़ी एन्क्रिप्शन की जानकारी के साथ जोड़ा जाता है (ज़रूरत पड़ने पर):
C#
// Insert the conversion. ConversionsBatchUpdateRequest request = new ConversionsBatchUpdateRequest(); request.Conversions = new List<Conversion>() { conversion }; request.EncryptionInfo = encryptionInfo; ConversionsBatchUpdateResponse response = service.Conversions.Batchupdate(request, profileId).Execute();
Java
ConversionsBatchUpdateRequest request = new ConversionsBatchUpdateRequest(); request.setConversions(ImmutableList.of(conversion)); request.setEncryptionInfo(encryptionInfo); ConversionsBatchUpdateResponse response = reporting.conversions() .batchupdate(profileId, request).execute();
PHP
$batch = new Google_Service_Dfareporting_ConversionsBatchUpdateRequest(); $batch->setConversions([$conversion]); $batch->setEncryptionInfo($encryptionInfo); $result = $this->service->conversions->batchupdate( $values['user_profile_id'], $batch );
Python
# Update the conversion. request_body = { 'conversions': [conversion], 'encryptionInfo': encryption_info } request = service.conversions().batchupdate( profileId=profile_id, body=request_body) response = request.execute()
Ruby
# Construct the batch update request. batch_update_request = DfareportingUtils::API_NAMESPACE::ConversionsBatchUpdateRequest.new( conversions: [conversion], encryption_info: encryption_info ) # Update the conversion. result = service.batchupdate_conversion(profile_id, batch_update_request)
ध्यान रखें कि Campaign Manager 360, आपके अनुरोध में मौजूद हर कन्वर्ज़न में बदलाव करने की पूरी कोशिश करता है. इसके लिए, वह पूरे बैच को एक साथ अपडेट करने के बजाय, हर कन्वर्ज़न को अलग-अलग अपडेट करता है. अगर किसी बैच में कुछ कन्वर्ज़न अपडेट नहीं हो पाते हैं, तो भी अन्य कन्वर्ज़न अपडेट हो सकते हैं. इसलिए, हमारा सुझाव है कि आप हर कन्वर्ज़न की स्थिति का पता लगाने के लिए, दिखाए गए ConversionsBatchUpdateResponse की जांच करें:
C#
// Handle the batchinsert response. if (!response.HasFailures.Value) { Console.WriteLine("Successfully updated conversion for encrypted user ID {0}.", conversionUserId); } else { Console.WriteLine("Error(s) updating conversion for encrypted user ID {0}:", conversionUserId); ConversionStatus status = response.Status[0]; foreach(ConversionError error in status.Errors) { Console.WriteLine("\t[{0}]: {1}", error.Code, error.Message); } }
Java
if (!response.getHasFailures()) { System.out.printf("Successfully updated conversion for encrypted user ID %s.%n", encryptedUserId); } else { System.out.printf("Error(s) updating conversion for encrypted user ID %s:%n", encryptedUserId); // Retrieve the conversion status and report any errors found. If multiple conversions // were included in the original request, the response would contain a status for each. ConversionStatus status = response.getStatus().get(0); for (ConversionError error : status.getErrors()) { System.out.printf("\t[%s]: %s.%n", error.getCode(), error.getMessage()); } }
PHP
if (!$result->getHasFailures()) { printf( 'Successfully updated conversion for encrypted user ID %s.', $values['encrypted_user_id'] ); } else { printf( 'Error(s) updating conversion for encrypted user ID %s:<br><br>', $values['encrypted_user_id'] ); $status = $result->getStatus()[0]; foreach ($status->getErrors() as $error) { printf('[%s] %s<br>', $error->getCode(), $error->getMessage()); } }
Python
if not response['hasFailures']: print('Successfully updated conversion for encrypted user ID %s.' % encrypted_user_id) else: print('Error(s) updating conversion for encrypted user ID %s.' % encrypted_user_id) status = response['status'][0] for error in status['errors']: print('\t[%s]: %s' % (error['code'], error['message']))
Ruby
if result.has_failures puts format('Error(s) updating conversion for encrypted user ID %s.', existing_conversion[:encrypted_user_id]) status = result.status[0] status.errors.each do |error| puts format("\t[%s]: %s", error.code, error.message) end else puts format('Successfully updated conversion for encrypted user ID %s.', existing_conversion[:encrypted_user_id]) end
जैसा कि पहले देखा गया है, रिस्पॉन्स के status फ़ील्ड में, ओरिजनल अनुरोध में शामिल हर कन्वर्ज़न के लिए एक ConversionStatus ऑब्जेक्ट होगा. अगर आपको सिर्फ़ उन कन्वर्ज़न में दिलचस्पी है जो अपडेट नहीं हो पाए, तो hasFailures फ़ील्ड का इस्तेमाल करके यह तुरंत पता लगाया जा सकता है कि दिए गए बैच में कोई कन्वर्ज़न अपडेट नहीं हो पाया है या नहीं. हर गड़बड़ी के कोड को मैनेज करने और अपलोड न हो पाए किन कन्वर्ज़न को फिर से अपलोड करने की कोशिश करनी है (INTERNAL और NOT_FOUND), इस बारे में जानने के लिए अक्सर पूछे जाने वाले सवाल देखें.