रूपांतरण अपलोड करें

इस गाइड में, Campaign Manager 360 API Conversions सेवा का इस्तेमाल करके, ऑफ़लाइन कन्वर्ज़न अपलोड करने के बारे में निर्देश दिए गए हैं. जारी रखने से पहले, हमारा सुझाव है कि आप ऑफ़लाइन कन्वर्ज़न की जानकारी के लिए, खास जानकारी की समीक्षा करें. साथ ही, इस गाइड में बताए गए सिद्धांतों के बारे में जानें.

कन्वर्ज़न के रिसॉर्स कॉन्फ़िगर करें

कन्वर्ज़न अपलोड की प्रोसेस का पहला चरण एक या ज़्यादा Conversion रिसॉर्स ऑब्जेक्ट बनाना है. इनमें से हर ऑब्जेक्ट एक ही कन्वर्ज़न इवेंट को दिखाता है और उसमें कुछ ज़रूरी फ़ील्ड शामिल होते हैं:

फ़ील्ड जानकारी
floodlightActivityId वह फ़्लडलाइट गतिविधि जिससे यह कन्वर्ज़न जोड़ा जाएगा.
floodlightConfigurationId किसी गतिविधि में इस्तेमाल किया गया Floodlight कॉन्फ़िगरेशन.
ordinal एक ही दिन में एक ही डिवाइस या उपयोगकर्ता से मिले कन्वर्ज़न की डुप्लीकेट कॉपी बनाने के लिए इस्तेमाल की जाने वाली वैल्यू. ज़्यादा जानकारी के लिए अक्सर पूछे जाने वाले सवाल देखें.
timestampMicros Unix epoch के बाद से कन्वर्ज़न का टाइमस्टैंप, माइक्रोसेकंड में.

इसके अलावा, हर ऑब्जेक्ट में नीचे दिए गए फ़ील्ड में से एक होना चाहिए:

फ़ील्ड जानकारी
encryptedUserId %m Match मैक्रो या डेटा ट्रांसफ़र से एन्क्रिप्ट (सुरक्षित) किया गया एक यूज़र आईडी.
encryptedUserIdCandidates[] %m मैच मैक्रो या डेटा ट्रांसफ़र से एन्क्रिप्ट (सुरक्षित) किए गए यूज़र आईडी की सूची. तय किए गए timestampMicros से पहले रिकॉर्ड किए गए फ़्लडलाइट एक्सपोज़र के पहले आईडी का इस्तेमाल किया जाएगा. अगर किसी भी आईडी को मौजूदा एक्सपोज़र से मेल नहीं खाता है, तो गड़बड़ी का मैसेज मिलता है.
dclid Display क्लिक आइडेंटिफ़ायर, जिसे Campaign Manager 360 या Display & Video 360 ने जनरेट किया हो.
gclid Google Ads या Search Ads 360 से जनरेट किया गया Google क्लिक आइडेंटिफ़ायर.
matchId Floodlight टैग के ज़रिए Campaign Manager 360 को पास करने के लिए, विज्ञापन देने वाले का यूनीक आइडेंटिफ़ायर बनाया गया.
mobileDeviceId इसके साथ काम करने वाले CTV डिवाइस प्लैटफ़ॉर्म (Roku, Fire TV, Android TV, Apple TV, Xbox, Samsung, Vizio) से, IDFA या AdID फ़ॉर्मैट या विज्ञापन के लिए कनेक्टेड टीवी आइडेंटिफ़ायर को एन्क्रिप्ट (सुरक्षित) नहीं किया जाता. ध्यान दें कि Google, YouTube कनेक्टेड टीवी आईएफ़ए के साथ काम नहीं करता.

वैकल्पिक फ़ील्ड को रेफ़रंस दस्तावेज़ में दिए गए हैं. ध्यान दें कि रिपोर्ट चलाते समय कुछ मेट्रिक (जैसे, कुल कन्वर्ज़न) में गिने जाने के लिए कन्वर्ज़न फ़ील्ड, संख्या फ़ील्ड कम से कम एक होना चाहिए.

नीचे दिए गए उदाहरण में एक आसान कन्वर्ज़न संसाधन के मकसद को बनाया गया है:

C#

// Generate a timestamp in milliseconds since Unix epoch.
TimeSpan timeSpan = DateTime.UtcNow - new DateTime(1970, 1, 1);
long currentTimeInMilliseconds = (long) timeSpan.TotalMilliseconds;

// Find the Floodlight configuration ID based on the provided activity ID.
FloodlightActivity floodlightActivity =
    service.FloodlightActivities.Get(profileId, floodlightActivityId).Execute();
long floodlightConfigurationId = (long) floodlightActivity.FloodlightConfigurationId;

// Create the conversion.
Conversion conversion = new Conversion();
conversion.EncryptedUserId = conversionUserId;
conversion.FloodlightActivityId = floodlightActivityId;
conversion.FloodlightConfigurationId = floodlightConfigurationId;
conversion.Ordinal = currentTimeInMilliseconds.ToString();
conversion.TimestampMicros = currentTimeInMilliseconds * 1000;

Java

long currentTimeInMilliseconds = System.currentTimeMillis();

// Find Floodlight configuration ID based on the provided activity ID.
FloodlightActivity floodlightActivity = reporting.floodlightActivities()
    .get(profileId, floodlightActivityId).execute();
long floodlightConfigurationId = floodlightActivity.getFloodlightConfigurationId();

Conversion conversion = new Conversion();
conversion.setEncryptedUserId(encryptedUserId);
conversion.setFloodlightActivityId(floodlightActivityId);
conversion.setFloodlightConfigurationId(floodlightConfigurationId);
conversion.setOrdinal(String.valueOf(currentTimeInMilliseconds));
conversion.setTimestampMicros(currentTimeInMilliseconds * 1000);

129

$currentTimeInMicros = time() * 1000 * 1000;

// 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();

$conversion = new Google_Service_Dfareporting_Conversion();
$conversion->setEncryptedUserId($values['encrypted_user_id']);
$conversion->setFloodlightActivityId($values['floodlight_activity_id']);
$conversion->setFloodlightConfigurationId($floodlightConfigId);
$conversion->setOrdinal($currentTimeInMicros);
$conversion->setTimestampMicros($currentTimeInMicros);

Python

# Look up the Floodlight configuration ID based on activity ID.
floodlight_activity = service.floodlightActivities().get(
    profileId=profile_id, id=floodlight_activity_id).execute()
floodlight_config_id = floodlight_activity['floodlightConfigurationId']

current_time_in_micros = int(time.time() * 1000000)

# Construct the conversion.
conversion = {
    'encryptedUserId': encrypted_user_id,
    'floodlightActivityId': floodlight_activity_id,
    'floodlightConfigurationId': floodlight_config_id,
    'ordinal': current_time_in_micros,
    'timestampMicros': current_time_in_micros
}

Ruby

# Look up the Floodlight configuration ID based on activity ID.
floodlight_activity = service.get_floodlight_activity(profile_id,
  floodlight_activity_id)
floodlight_config_id = floodlight_activity.floodlight_configuration_id

current_time_in_micros = DateTime.now.strftime('%Q').to_i * 1000

# Construct the conversion.
conversion = DfareportingUtils::API_NAMESPACE::Conversion.new(
  encrypted_user_id: encrypted_user_id,
  floodlight_activity_id: floodlight_activity_id,
  floodlight_configuration_id: floodlight_config_id,
  ordinal: current_time_in_micros,
  timestamp_micros: current_time_in_micros
)

एन्क्रिप्ट (सुरक्षित) करने की जानकारी दें

अगर आपको ऑफ़लाइन कन्वर्ज़न को, एन्क्रिप्ट (सुरक्षित) किए गए यूज़र आईडी के साथ एट्रिब्यूट करना है, तो जैसा कि पिछले उदाहरण में बताया गया है, आपको यह जानकारी देनी होगी कि इंसर्ट अनुरोध के हिस्से के तौर पर उन्हें कैसे एन्क्रिप्ट (सुरक्षित) किया जाता है. खास तौर पर, आपके लिए यह जानना ज़रूरी है कि:

  1. एन्क्रिप्ट (सुरक्षित) करने का तरीका: यह बताता है कि एन्क्रिप्ट किए गए आईडी का बैच कहां से आता है. स्वीकार की जाने वाली वैल्यू, %m मैच मैक्रो से लिए गए आईडी के लिए AD_SERVING और डेटा ट्रांसफ़र फ़ाइलों से लिए गए आईडी के लिए DATA_TRANSFER होते हैं.

  2. एन्क्रिप्ट करने की इकाई, User-ID को एन्क्रिप्ट (सुरक्षित) करने के लिए इस्तेमाल की जाने वाली वैल्यू का एक खास सेट होती है. आम तौर पर, ये मान उस समय Campaign Manager 360 खाते से जुड़े होते हैं जब सोर्स, डेटा ट्रांसफ़र होता है या जब सोर्स सोर्स %m मैक्रो होता है, तो Campaign Manager 360 विज्ञापन देने वाले से हमेशा ऐसा नहीं होता. अगर आपको पक्के तौर पर नहीं पता है, तो ज़्यादा जानकारी के लिए, अपने Campaign Manager 360 खाता प्रतिनिधि या Campaign Manager 360 की सहायता टीम से संपर्क करें.

ज़रूरत पड़ने पर, 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);

129

$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]
)

ध्यान रखें कि शामिल किए जाने के हर अनुरोध में सिर्फ़ एक EncryptionInfo ऑब्जेक्ट हो सकता है. इसका मतलब है कि दिए गए अनुरोध में शामिल सभी कन्वर्ज़न, एक ही स्रोत से होने चाहिए और उन्हें एक ही एन्क्रिप्शन इकाई का इस्तेमाल करना चाहिए.

शामिल करने का अनुरोध जनरेट करें

इस प्रक्रिया के आखिरी चरण में, batchinsert को कॉल करके अपने कन्वर्ज़न अपलोड किए जाते हैं. इस तरीके से ConversionsBatchInsertRequest ऑब्जेक्ट स्वीकार किया जाता है. यह ऑब्जेक्ट, कन्वर्ज़न के सेट को उनसे जुड़े एन्क्रिप्शन की जानकारी के साथ मिला देता है (ज़रूरी होने पर):

C#

// Insert the conversion.
ConversionsBatchInsertRequest request = new ConversionsBatchInsertRequest();
request.Conversions = new List<Conversion>() { conversion };
request.EncryptionInfo = encryptionInfo;

ConversionsBatchInsertResponse response =
    service.Conversions.Batchinsert(request, profileId).Execute();

Java

ConversionsBatchInsertRequest request = new ConversionsBatchInsertRequest();
request.setConversions(ImmutableList.of(conversion));
request.setEncryptionInfo(encryptionInfo);

ConversionsBatchInsertResponse response = reporting.conversions()
    .batchinsert(profileId, request).execute();

129

$batch = new Google_Service_Dfareporting_ConversionsBatchInsertRequest();
$batch->setConversions([$conversion]);
$batch->setEncryptionInfo($encryptionInfo);

$result = $this->service->conversions->batchinsert(
    $values['user_profile_id'],
    $batch
);

Python

# Insert the conversion.
request_body = {
    'conversions': [conversion],
    'encryptionInfo': encryption_info
}
request = service.conversions().batchinsert(profileId=profile_id,
                                            body=request_body)
response = request.execute()

Ruby

# Construct the batch insert request.
batch_insert_request =
  DfareportingUtils::API_NAMESPACE::ConversionsBatchInsertRequest.new(
    conversions: [conversion],
    encryption_info: encryption_info
  )

# Insert the conversion.
result = service.batchinsert_conversion(profile_id, batch_insert_request)

ध्यान रखें कि Campaign Manager 360, आपके अनुरोध में मौजूद हर कन्वर्ज़न को सबसे अच्छे तरीके से डालने की कोशिश करता है. इसके लिए, पूरे बैच को एक पूरे लेन-देन के तौर पर शामिल नहीं किया जाता. अगर बैच में कुछ कन्वर्ज़न शामिल नहीं हो पाते हैं, तो दूसरे कन्वर्ज़न अब भी शामिल किए जा सकते हैं. इसलिए, सुझाव दिया जाता है कि आप हर कन्वर्ज़न की स्थिति तय करने के लिए, लौटाए गए ConversionsBatchInsertResponse की जांच करें:

C#

// Handle the batchinsert response.
if (!response.HasFailures.Value) {
  Console.WriteLine("Successfully inserted conversion for encrypted user ID {0}.",
      conversionUserId);
} else {
  Console.WriteLine("Error(s) inserting 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 inserted conversion for encrypted user ID %s.%n",
      encryptedUserId);
} else {
  System.out.printf("Error(s) inserting 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());
  }
}

129

if (!$result->getHasFailures()) {
    printf(
        'Successfully inserted conversion for encrypted user ID %s.',
        $values['encrypted_user_id']
    );
} else {
    printf(
        'Error(s) inserting 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 inserted conversion for encrypted user ID %s.'
         % encrypted_user_id)
else:
  print ('Error(s) inserting 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) inserting conversion for encrypted user ID %s.',
    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 inserted conversion for encrypted user ID %s.',
    encrypted_user_id)
end

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

पुष्टि करें कि कन्वर्ज़न प्रोसेस हुए

आम तौर पर, अपलोड किए गए कन्वर्ज़न 24 घंटों के अंदर प्रोसेस कर दिए जाएंगे और रिपोर्ट में उपलब्ध कर दिए जाएंगे. आपने जो कन्वर्ज़न अपलोड किए हैं वे प्रोसेस हुए हैं या नहीं, इस बात की पुष्टि करने के लिए यह सुझाव दिया जाता है कि आप Floodlight इंप्रेशन रिपोर्ट चलाएं. दूसरी एट्रिब्यूशन रिपोर्ट के उलट, इनमें एट्रिब्यूट (किसी विज्ञापन से जुड़े) और एट्रिब्यूट नहीं किए गए, दोनों कन्वर्ज़न डिफ़ॉल्ट रूप से दिखेंगे. इससे यह तुरंत पता लगाया जा सकता है कि आपने जो कन्वर्ज़न भेजे हैं वे Campaign Manager 360 पर गए हैं या नहीं.