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

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

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

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

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

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

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

आखिर में, हर कन्वर्ज़न की दो मेट्रिक होती हैं:

फ़ील्ड जानकारी
quantity ज़रूरी है. कन्वर्ज़न से जुड़े आइटम की संख्या. कुछ मेट्रिक (जैसे, कुल कन्वर्ज़न) में कन्वर्ज़न की गिनती करने के लिए, यह कम से कम एक होना चाहिए.
value कन्वर्ज़न से जुड़ी डॉलर की रकम. Floodlight कॉन्फ़िगरेशन के मालिकाना हक वाले विज्ञापन देने वाले की मुद्रा के हिसाब से तय की जाती है.

वैकल्पिक फ़ील्ड के बारे में रेफ़रंस दस्तावेज़ में बताया गया है.

नीचे दिए गए उदाहरण में, एक सामान्य कन्वर्ज़न रिसॉर्स ऑब्जेक्ट बनाने का तरीका बताया गया है:

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

PHP

$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=str(profile_id), id=str(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. एन्क्रिप्शन इकाई, जो यूज़र आईडी को एन्क्रिप्ट करने के लिए इस्तेमाल की जाने वाली वैल्यू का एक यूनीक सेट है. आम तौर पर, ये वैल्यू Campaign Manager 360 खाते से जुड़ी होती हैं. ऐसा तब होता है, जब सोर्स डेटा ट्रांसफ़र हो. इसके अलावा, ये वैल्यू Campaign Manager 360 में विज्ञापन देने वाले व्यक्ति या कंपनी से जुड़ी होती हैं. ऐसा तब होता है, जब सोर्स %m मैक्रो हो. हालांकि, ऐसा हमेशा नहीं होता. अगर आपको इस बारे में जानकारी नहीं है, तो ज़्यादा जानकारी के लिए अपने 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);

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

ध्यान रखें कि हर इंसर्ट अनुरोध में सिर्फ़ एक 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();

PHP

$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=str(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());
  }
}

PHP

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 फ़ील्ड का इस्तेमाल करके यह तुरंत पता लगाया जा सकता है कि दिए गए बैच में मौजूद कोई कन्वर्ज़न अपलोड नहीं हो पाया है या नहीं. हर गड़बड़ी के कोड को मैनेज करने और अपलोड न हो पाए किन कन्वर्ज़न को फिर से अपलोड करने की कोशिश करनी है (INTERNAL और NOT_FOUND), इस बारे में जानने के लिए अक्सर पूछे जाने वाले सवाल देखें.

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

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