এই নির্দেশিকাটি ক্যাম্পেইন ম্যানেজার ৩৬০ এপিআই Conversions পরিষেবা ব্যবহার করে কনভার্সন সম্পাদনা করার জন্য বিস্তারিত নির্দেশনা প্রদান করে। সামনে এগোনোর আগে, অফলাইন কনভার্সন সম্পর্কে প্রাথমিক ধারণা পেতে এবং এই নির্দেশিকায় আলোচিত ধারণাগুলোর সাথে পরিচিত হওয়ার জন্য ওভারভিউ অংশটি পর্যালোচনা করার পরামর্শ দেওয়া হচ্ছে।
শুরু করার আগে
এই সম্পাদনা কর্মপ্রবাহটি আপনাকে বিদ্যমান অনলাইন এবং অফলাইন কনভার্সনগুলির quantity ও value পরিবর্তন করার সুযোগ দেয়। এটি করার জন্য, আপনাকে এমন কিছু মান প্রদান করতে হবে যা সম্পাদনাযোগ্য কনভার্সনগুলিকে অনন্যভাবে শনাক্ত করে। আপনি কোন ধরনের কনভার্সন সম্পাদনা করছেন তার উপর নির্ভর করে, এই মানগুলি বিভিন্ন উপায়ে সংগ্রহ করতে পারবেন:
অনলাইন রূপান্তর শনাক্ত করার জন্য প্রয়োজনীয় মানগুলো ডেটা ট্রান্সফার থেকে পাওয়া যেতে পারে।
সফল
batchinsertঅনুরোধেরConversionsBatchInsertResponseএ অফলাইন রূপান্তর শনাক্ত করার জন্য প্রয়োজনীয় মানগুলি ফেরত দেওয়া হয়।
একবার আপনি যেকোনো ধরনের রূপান্তর সফলভাবে সম্পাদনা করলে, ConversionsBatchUpdateResponse এ পরবর্তী সম্পাদনাগুলো করার জন্য প্রয়োজনীয় মানগুলো থাকবে।
রূপান্তর সংস্থানগুলি কনফিগার করুন
সম্পাদনা কর্মপ্রবাহের প্রথম ধাপে এক বা একাধিক Conversion রিসোর্স অবজেক্ট তৈরি করতে হয়।
সম্পাদনার জন্য একটি কনভার্সন শনাক্ত করতে নিম্নলিখিত ফিল্ডগুলো ব্যবহৃত হয়। এই ফিল্ডগুলো আবশ্যক এবং অবশ্যই একটি বিদ্যমান কনভার্সনের সাথে হুবহু মিলতে হবে।
| মাঠ | বর্ণনা |
|---|---|
| এনক্রিপ্টেড ইউজার আইডি, গুগল ক্লিক আইডি, ডিসপ্লে ক্লিক আইডি, ম্যাচ আইডি, অথবা মোবাইল ডিভাইস আইডি যা কনভার্সনটি তৈরি করেছে। |
floodlightActivityId | ফ্লাডলাইট অ্যাক্টিভিটি, যার সাথে রূপান্তরটি সম্পর্কিত। |
floodlightConfigurationId | নির্দিষ্ট অ্যাক্টিভিটি দ্বারা ব্যবহৃত ফ্লাডলাইট কনফিগারেশন। |
ordinal | রূপান্তরের সাথে যুক্ত ডিডুপ্লিকেশন শনাক্তকারী । |
timestampMicros | ইউনিক্স ইপক থেকে মাইক্রোসেকেন্ডে রূপান্তরের টাইমস্ট্যাম্প। |
যে ক্ষেত্রগুলো সম্পাদনা করা যাবে, সেগুলো নিচে তালিকাভুক্ত করা হলো।
এই ফিল্ডগুলো আবশ্যক এবং আপনার দেওয়া মানগুলো সম্পাদিতব্য কনভার্সনটিতে আগে থেকে থাকা যেকোনো মানকে মুছে দেবে।
| মাঠ | বর্ণনা |
|---|---|
quantity | রূপান্তরের সাথে সংশ্লিষ্ট আইটেমের সংখ্যা। |
value | রূপান্তরের ফলে অর্জিত রাজস্বের পরিমাণ। |
এই ক্ষেত্রগুলো ঐচ্ছিক। সেট না করা হলে মান অপরিবর্তিত থাকবে।
| মাঠ | বর্ণনা |
|---|---|
customVariables | রূপান্তরের কাস্টম ফ্লাডলাইট ভেরিয়েবল। ভেরিয়েবলটি সেট করা থাকলে এর মান আপডেট বা সন্নিবেশ করা হবে। সেট করা না থাকলে ভেরিয়েবলের মান অপরিবর্তিত থাকে। |
রেফারেন্স ডকুমেন্টেশনে উল্লেখিত অন্য সকল ফিল্ড অসমর্থিত এবং পরিবর্তনযোগ্য নয়। আপনার সম্পাদনার অনুরোধে অসমর্থিত ফিল্ড অন্তর্ভুক্ত করলে একটি ত্রুটি দেখা দেবে। যদি সম্পাদিতব্য রূপান্তরটিতে কোনো অসমর্থিত ফিল্ডের জন্য পূর্ব-বিদ্যমান মান থাকে, তবে সেই মানগুলি স্বয়ংক্রিয়ভাবে সংরক্ষিত হবে।
নিচের উদাহরণটি সম্পাদনার জন্য একটি সাধারণ রূপান্তর রিসোর্স অবজেক্ট তৈরি করার পদ্ধতি ব্যাখ্যা করে:
সি#
// 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;
জাভা
// 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);
পিএইচপি
// 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']);
পাইথন
# 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
রুবি
# 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 অবজেক্ট তৈরি করা হলো সম্পাদনা কর্মপ্রবাহের দ্বিতীয় ধাপ:
সি#
// Create the encryption info. EncryptionInfo encryptionInfo = new EncryptionInfo(); encryptionInfo.EncryptionEntityId = encryptionEntityId; encryptionInfo.EncryptionEntityType = encryptionEntityType; encryptionInfo.EncryptionSource = encryptionSource;
জাভা
// Create the encryption info. EncryptionInfo encryptionInfo = new EncryptionInfo(); encryptionInfo.setEncryptionEntityId(encryptionEntityId); encryptionInfo.setEncryptionEntityType(encryptionEntityType); encryptionInfo.setEncryptionSource(encryptionSource);
পিএইচপি
$encryptionInfo = new Google_Service_Dfareporting_EncryptionInfo(); $encryptionInfo->setEncryptionEntityId($values['encryption_entity_id']); $encryptionInfo->setEncryptionEntityType($values['encryption_entity_type']); $encryptionInfo->setEncryptionSource($values['encryption_source']);
পাইথন
# Construct the encryption info. encryption_info = { 'encryptionEntityId': encryption_entity_id, 'encryptionEntityType': encryption_entity_type, 'encryptionSource': encryption_source }
রুবি
# 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 অবজেক্ট গ্রহণ করে, যা সম্পাদনা করার জন্য কনভার্সনগুলোর সেটকে তাদের সংশ্লিষ্ট এনক্রিপশন তথ্যের (প্রয়োজনে) সাথে একত্রিত করে:
সি#
// Insert the conversion. ConversionsBatchUpdateRequest request = new ConversionsBatchUpdateRequest(); request.Conversions = new List<Conversion>() { conversion }; request.EncryptionInfo = encryptionInfo; ConversionsBatchUpdateResponse response = service.Conversions.Batchupdate(request, profileId).Execute();
জাভা
ConversionsBatchUpdateRequest request = new ConversionsBatchUpdateRequest(); request.setConversions(ImmutableList.of(conversion)); request.setEncryptionInfo(encryptionInfo); ConversionsBatchUpdateResponse response = reporting.conversions() .batchupdate(profileId, request).execute();
পিএইচপি
$batch = new Google_Service_Dfareporting_ConversionsBatchUpdateRequest(); $batch->setConversions([$conversion]); $batch->setEncryptionInfo($encryptionInfo); $result = $this->service->conversions->batchupdate( $values['user_profile_id'], $batch );
পাইথন
# Update the conversion. request_body = { 'conversions': [conversion], 'encryptionInfo': encryption_info } request = service.conversions().batchupdate( profileId=profile_id, body=request_body) response = request.execute()
রুবি
# 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)
মনে রাখবেন যে, ক্যাম্পেইন ম্যানেজার 360 আপনার অনুরোধের প্রতিটি কনভার্সনকে একবারে সম্পূর্ণ বা পুরোপুরি আপডেট না করে, বরং সর্বোচ্চ চেষ্টার ভিত্তিতে সম্পাদনা করার চেষ্টা করে। যদি একটি ব্যাচের কিছু কনভার্সন আপডেট হতে ব্যর্থ হয়, তবে অন্যগুলো সফলভাবে আপডেট হয়ে যেতে পারে। তাই, প্রতিটি কনভার্সনের অবস্থা জানার জন্য, ফেরত আসা ConversionsBatchUpdateResponse পরীক্ষা করে দেখার পরামর্শ দেওয়া হচ্ছে।
সি#
// 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); } }
জাভা
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()); } }
পিএইচপি
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()); } }
পাইথন
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']))
রুবি
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 ফিল্ডটি ব্যবহার করা যেতে পারে।