কনভার্সন এডিট করুন

Campaign Manager 360 API Conversions পরিষেবা ব্যবহার করে কনভার্সন এডিট করার জন্য এই নির্দেশিকায় বিস্তারিত তথ্য দেওয়া আছে। চালিয়ে যাওয়ার আগে, অফলাইন কনভার্সনের ভূমিকা এবং এই গাইডে আলোচনা করা ধারণা সম্পর্কে পরিচিত হতে এক নজরে পর্যালোচনা করার সাজেশন দেওয়া হয়।

শুরু করার আগে

এই এডিট ওয়ার্কফ্লো আপনাকে আগে থেকে থাকা অনলাইন ও অফলাইন কনভার্সনের quantity ও value পরিবর্তন করতে দেয়। এটি করতে, আপনাকে এমন ভ্যালু প্রদান করতে হবে যা এডিট করা কনভার্সনগুলিকে অনন্যভাবে শনাক্ত করে। আপনি যে ধরনের কনভার্সন এডিট করছেন তার উপর নির্ভর করে, আপনি বিভিন্ন উপায়ে এইসব ভ্যালু পাবেন:

  • অনলাইন কনভার্সন শনাক্ত করার জন্য প্রয়োজনীয় ভ্যালু ডেটা ট্রান্সফার থেকে পাওয়া যেতে পারে।

  • অফলাইন কনভার্সন শনাক্ত করার জন্য প্রয়োজনীয় ভ্যালু batchinsertটি অনুরোধের মধ্যে ConversionsBatchInsertResponseটিতে পাওয়া গেছে।

আপনি যেকোনও ধরনের কনভার্সন সফলভাবে এডিট করার পরে, ConversionsBatchUpdateResponse-এ পরবর্তী এডিট করার জন্য প্রয়োজনীয় ভ্যালু থাকবে।

কনভার্সন রিসোর্স কনফিগার করুন

এডিট ওয়ার্কফ্লোয়ের প্রথম ধাপে এক বা একাধিক Conversion রিসোর্স অবজেক্ট তৈরি করতে হয়।

এডিট করার জন্য কনভার্সন শনাক্ত করতে নিম্নলিখিত ফিল্ড ব্যবহার করা হয়। এইসব ফিল্ড পূরণ করা আবশ্যক এবং আগে থেকে থাকা কনভার্সনের সাথে অবশ্যই মিলতে হবে।

ফিল্ড বিবরণ

encryptedUserId বা gclid বা dclid বা matchid বা mobileDeviceId

এনক্রিপ্ট করা ব্যবহারকারীর আইডি, Google ক্লিক আইডি, ডিসপ্লে ক্লিক আইডি, ম্যাচ আইডি বা মোবাইল ডিভাইস আইডি যা কনভার্সন জেনারেট করেছে।
floodlightActivityId যে ফ্লাডলাইট অ্যাক্টিভিটিতে কনভার্সন অ্যাট্রিবিউট করা হয়েছে।
floodlightConfigurationId নির্দিষ্ট অ্যাক্টিভিটির মাধ্যমে ব্যবহার করা Floodlight কনফিগারেশন।
ordinal কনভার্সনের সাথে যুক্ত ডুপ্লিকেট শনাক্তকারী।
timestampMicros কনভার্সনের টাইমস্ট্যাম্প, Unix epoch থেকে মাইক্রোসেকেন্ডে।

যেসব ফিল্ড এডিট করা যাবে সেগুলি নিচে তালিকাভুক্ত করা হয়েছে।

এইসব ফিল্ডে তথ্য দেওয়া আবশ্যক এবং আপনি যে ভ্যালু দেবেন তা এডিট করা কনভার্সনে আগে থেকে থাকা যেকোনও ভ্যালুকে ওভাররাইট করবে।

ফিল্ড বিবরণ
quantity কনভার্সনের সাথে যুক্ত আইটেমের সংখ্যা।
value কনভার্সন থেকে হওয়া উপার্জনের পরিমাণ।

এইসব ফিল্ড ঐচ্ছিক। সেট করা না থাকলে, ভ্যালু অপরিবর্তিত থাকবে।

ফিল্ড বিবরণ
customVariables কনভার্সনের কাস্টম ফ্লাডলাইট ভেরিয়েবেল। ভেরিয়েবেল সেট করা থাকলে মান আপডেট বা ইনসার্ট করবে। সেট করা না থাকলে ভেরিয়েবেলের ভ্যালু অপরিবর্তিত থাকে।

রেফারেন্স ডকুমেন্টেশনে উল্লেখ করা অন্য সব ফিল্ড কাজ করে না এবং পরিবর্তন করা যায় না। আপনার এডিট করার অনুরোধে কাজ করে না এমন ফিল্ড অন্তর্ভুক্ত করলে সমস্যা হবে। এডিট করা কনভার্সনে যদি আগে থেকে থাকা কোনও মান থাকে যা কোনও ফিল্ডের সাথে কাজ করে না, তাহলে সেই মান অটোমেটিক সেভ হয়ে যাবে।

এডিট করার জন্য একটি সাধারণ কনভার্সন রিসোর্স অবজেক্ট তৈরি করার বিষয়টি নিচের উদাহরণে দেখানো হয়েছে:

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) সেই বিষয়ে নির্দেশনার জন্য, প্রায়শই জিজ্ঞাসিত প্রশ্ন দেখুন।