অফলাইন রূপান্তর পরিচালনা করুন

আপনি গুগল অ্যাডস এপিআই (Google Ads API) ব্যবহার করে অফলাইন কনভার্সনগুলো গুগল অ্যাডস-এ ইম্পোর্ট করতে পারেন, যার মাধ্যমে অফলাইন জগতে (যেমন ফোনে বা কোনো সেলস প্রতিনিধির মাধ্যমে) বিক্রি হওয়া বিজ্ঞাপনগুলো ট্র্যাক করা যায়।

কনভার্সন ডেটা ইম্পোর্ট করার সুবিধাগুলোর পূর্ণ সদ্ব্যবহার করার জন্য, আমরা লিডগুলোর জন্য উন্নত কনভার্সন প্রয়োগ করার পরামর্শ দিই, যা স্থায়িত্ব ও কর্মক্ষমতা সর্বোচ্চ করতে GCLID এবং ব্যবহারকারীর দেওয়া ডেটা ব্যবহার করে।

উন্নত রূপান্তর

এনহ্যান্সড কনভার্সন আপনার কনভার্সনের সাথে ইমেল অ্যাড্রেস, ফোন নম্বর এবং মেইলিং অ্যাড্রেসের মতো ফার্স্ট-পার্টি কনভার্সন ডেটা যুক্ত করে আপনার কনভার্সন পরিমাপের নির্ভুলতা বাড়াতে সাহায্য করে।

উন্নত রূপান্তর দুই প্রকারের হয়। আরও বিস্তারিত জানতে, ‘উন্নত রূপান্তর সম্পর্কে’ দেখুন।

নিম্নলিখিত বিভাগে অফলাইন রূপান্তর কীভাবে উন্নত করা যায় তা ব্যাখ্যা করা হয়েছে, এই বৈশিষ্ট্যটি লিডের জন্য উন্নত রূপান্তর হিসাবেও পরিচিত।

লিডের জন্য বর্ধিত রূপান্তর বলতে কী বোঝায়?

লিডের জন্য উন্নত কনভার্সন হলো অফলাইন কনভার্সন ইম্পোর্টের একটি আপগ্রেড সংস্করণ, যা নির্ভুলতা এবং বিডিং পারফরম্যান্স উন্নত করার জন্য ইম্পোর্ট করা অফলাইন কনভার্সন ডেটার পরিপূরক হিসেবে ব্যবহারকারীর দেওয়া ডেটা, যেমন ইমেল অ্যাড্রেস, ব্যবহার করে। আপনি যখন আপনার অফলাইন কনভার্সন ইম্পোর্ট করেন, তখন প্রদত্ত হ্যাশ করা গ্রাহক ডেটা আপনার ওয়েবসাইটে সংগৃহীত একই ডেটার (যেমন একটি লিড ফর্ম) সাথে এবং আপনার বিজ্ঞাপনের সাথে যুক্ত হওয়া সাইন-ইন করা গ্রাহকদের সাথে মিলিয়ে গুগল অ্যাডস ক্যাম্পেইনের সাথে সংযুক্ত করতে ব্যবহৃত হয়। আরও তথ্যের জন্য, ‘লিডের জন্য উন্নত কনভার্সন সম্পর্কে’ দেখুন।

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

  • আপনি যদি একেবারে শুরু থেকে শুরু করেন, তাহলে পূর্বশর্ত অংশটি দিয়ে শুরু করুন।
  • আপনার যদি ইতিমধ্যেই অফলাইন কনভার্সন ইম্পোর্ট সেট আপ করা থাকে এবং আপনি লিডগুলির জন্য উন্নত কনভার্সনে আপগ্রেড করতে চান, তাহলে আমরা ট্যাগিং কনফিগার করুন (Configure tagging) বিভাগটি দিয়ে শুরু করার পরামর্শ দিই।
  • যদি আপনি ইতিমধ্যেই গুগল ট্যাগ সেট আপ করে থাকেন, অথবা গুগল ট্যাগ ব্যবহার করার পরিকল্পনা না থাকে এবং আপনার গুগল অ্যাডস এপিআই ইন্টিগ্রেশনের কাজ শুরু করতে চলেছেন, তাহলে সরাসরি এপিআই ইমপ্লিমেন্টেশন বিভাগে চলে যান।
  • যদি আপনি ব্যবহারকারী-প্রদত্ত ডেটা ইম্পোর্ট করতে না পারেন, অথবা আপনার রূপান্তরের জন্য বাহ্যিক অ্যাট্রিবিউশনের উপর নির্ভর করেন, তাহলে লিগ্যাসি অফলাইন কনভার্সন ইমপোর্টস গাইডটি দেখুন।

পূর্বশর্ত

প্রথমে, আমাদের 'শুরু করার নির্দেশিকা' বিভাগে দেওয়া ধাপগুলো আপনি সম্পন্ন করেছেন কিনা তা যাচাই করে নিন।

লিডের জন্য উন্নত রূপান্তর ব্যবহার করার আগে, আপনাকে অবশ্যই লিডের জন্য উন্নত রূপান্তরে অপ্ট-ইন করতে হবে এবং গ্রাহক ডেটার শর্তাবলী গ্রহণ করতে হবে। এই পূর্বশর্তগুলি ইতিমধ্যে পূরণ হয়েছে কিনা তা আপনি Google Ads রূপান্তর গ্রাহককে নিম্নলিখিত কোয়েরিটি পাঠিয়ে যাচাই করতে পারেন:

SELECT
  customer.id,
  customer.conversion_tracking_setting.accepted_customer_data_terms,
  customer.conversion_tracking_setting.enhanced_conversions_for_leads_enabled
FROM customer

যদি accepted_customer_data_terms অথবা enhanced_conversions_for_leads_enabled এর কোনো একটি false হয়, তাহলে এই পূর্বশর্তগুলো সম্পূর্ণ করতে Create a new conversion action- এর নির্দেশাবলী অনুসরণ করুন।

ট্যাগিং কনফিগার করুন

লিডদের জন্য উন্নত কনভার্সন চালু করতে, 'গুগল ট্যাগ সেটিংস কনফিগার করুন' এর নির্দেশাবলী অনুসরণ করে গুগল ট্যাগটি কনফিগার করুন। গুগল ট্যাগ ম্যানেজারের মাধ্যমে লিডদের জন্য উন্নত কনভার্সন সেট আপ করতে, এই নির্দেশাবলী অনুসরণ করুন।

এপিআই বাস্তবায়ন

গুগল অ্যাডস এপিআই ব্যবহার করে লিডগুলোর জন্য উন্নত কনভার্সন ইম্পোর্ট করার সামগ্রিক কার্যপ্রবাহ নিচে দেওয়া হলো।

  1. ব্যবহারকারীর দেওয়া ডেটা, যেমন ইমেল ঠিকানা, ফোন নম্বর এবং ডাক ঠিকানা, স্বাভাবিক করুন এবং হ্যাশ করুন

  2. ClickConversion অবজেক্টগুলি পূরণ করুন

    স্বাভাবিকীকৃত এবং হ্যাশ করা ব্যবহারকারী-প্রদত্ত ডেটা সহ

  3. ConversionUploadService ব্যবহার করে Google Ads API-তে ClickConversion অবজেক্টগুলো ইম্পোর্ট করুন । আরও বিস্তারিত জানতে UploadClickConversions দেখুন।

  4. আপনার আমদানিগুলো পর্যালোচনা করুন

আপনার রূপান্তর ক্রিয়া রিসোর্সের নাম পুনরুদ্ধার করুন

কনভার্সন আপলোড করতে, আপনাকে অবশ্যই Google Ads-এ ক্লিক কনভার্সন ইম্পোর্ট করার জন্য সেট আপ করা ConversionAction এর রিসোর্স নামটি উল্লেখ করতে হবে। আপনি নিম্নলিখিত GAQL কোয়েরি ব্যবহার করে conversion_action রিসোর্সটি কোয়েরি করার মাধ্যমে রিসোর্স নামটি খুঁজে পেতে পারেন:

SELECT
  customer.id,
  conversion_action.id,
  conversion_action.name,
  conversion_action.type,
  conversion_action.resource_name
FROM conversion_action
WHERE conversion_action.type = 'UPLOAD_CLICKS'
  AND conversion_action.status = 'ENABLED'

ব্যবহারকারীর দেওয়া ডেটা স্বাভাবিক করুন এবং হ্যাশ করুন

গোপনীয়তার স্বার্থে, নিম্নলিখিত ডেটা আমদানি করার আগে অবশ্যই SHA-256 ব্যবহার করে হ্যাশ করতে হবে:

  • ইমেইল ঠিকানা
  • ফোন নম্বর
  • প্রথম নাম
  • শেষ নাম
  • রাস্তার ঠিকানা

হ্যাশ ফলাফলগুলোকে মানসম্মত করার জন্য, এই মানগুলোর প্রত্যেকটিকে হ্যাশ করার আগে নিম্নলিখিত কাজগুলো করুন:

  • শুরুতে ও শেষে থাকা অতিরিক্ত স্পেস মুছে ফেলুন।
  • লেখাটিকে ছোট হাতের অক্ষরে রূপান্তর করুন।
  • E164 স্ট্যান্ডার্ড অনুযায়ী ফোন নম্বর ফরম্যাট করুন।

উন্নত রূপান্তরের জন্য ইমেল ঠিকানা বিন্যাস

উন্নত কনভার্সনের জন্য সর্বোচ্চ ম্যাচ রেট নিশ্চিত করতে, হ্যাশ করার আগে আপনাকে অবশ্যই ইমেল অ্যাড্রেসগুলো সঠিকভাবে ফরম্যাট করতে হবে। এই ধাপগুলো অনুসরণ করুন:

  1. স্ট্যান্ডার্ড নর্মালাইজেশন প্রয়োগ করুন (সকল ইমেল ঠিকানার জন্য):

    • শুরুতে বা শেষে থাকা যেকোনো অতিরিক্ত স্থান মুছে ফেলুন।
    • সম্পূর্ণ ইমেল ঠিকানাটিকে ছোট হাতের অক্ষরে রূপান্তর করুন।
  2. প্রযোজ্য ক্ষেত্রে, Gmail/Googlemail-এর জন্য নির্দিষ্ট স্বাভাবিকীকরণ প্রয়োগ করুন:

    • এই ধাপটি শুধুমাত্র gmail.com এবং googlemail.com ডোমেইনযুক্ত ইমেল ঠিকানাগুলোর ক্ষেত্রে প্রযোজ্য।
    • ডট ( . ) সরান: ইউজারনেমের অংশ থেকে ( @ এর আগে) সমস্ত ডট অক্ষর মুছে ফেলুন।
    • প্লাস চিহ্ন ( + ) বাদ দিন: ইউজারনেম অংশ থেকে প্লাস চিহ্ন ( + ) এবং এর পরের সমস্ত অক্ষর মুছে ফেলুন।

      • উদাহরণ: Jane.Doe+Shopping@googlemail.com প্রথমে jane.doe+shopping@googlemail.com (ছোট হাতের অক্ষরে) হয়, এবং তারপর janedoe@googlemail.com হয় (Gmail/Googlemail-এর নির্দিষ্ট নিয়ম অনুযায়ী)।
    • অন্যান্য ডোমেইন: gmail.com বা googlemail.com ছাড়া অন্য কোনো ডোমেইনের ইমেল ঠিকানার ইউজারনেম থেকে পিরিয়ড (.) বা প্লাস (.) সাফিক্স সরানো উচিত নয়। এই ঠিকানাগুলিতে শুধুমাত্র সাধারণ নর্মালাইজেশন (ছোট হাতের অক্ষর, অতিরিক্ত স্পেস বাদ দেওয়া) প্রয়োগ করুন।

      • উদাহরণ: user.name+NYC@Example.com স্বাভাবিক হয়ে user.name+nyc@example.com হবে।
  3. স্বাভাবিককৃত ইমেল ঠিকানাটি হ্যাশ করুন:

    • যথাযথ স্বাভাবিকীকরণ ধাপগুলো প্রয়োগ করার পর, প্রাপ্ত ইমেল ঠিকানাটিকে SHA-256 অ্যালগরিদম ব্যবহার করে হ্যাশ করুন।

নিম্নলিখিত ডেটা হ্যাশ করবেন না :

  • দেশ
  • রাজ্য
  • শহর
  • জিপ কোড

কোডের উদাহরণ

এই উদাহরণটি দেখায় কিভাবে ব্যবহারকারীর দেওয়া ডেটা নর্মালাইজ এবং হ্যাশ করতে হয়।

জাভা

private String normalizeAndHash(MessageDigest digest, String s)
    throws UnsupportedEncodingException {
  // Normalizes by first converting all characters to lowercase, then trimming spaces.
  String normalized = s.toLowerCase();
  // Removes leading, trailing, and intermediate spaces.
  normalized = normalized.replaceAll("\\s+", "");
  // Hashes the normalized string using the hashing algorithm.
  byte[] hash = digest.digest(normalized.getBytes("UTF-8"));
  StringBuilder result = new StringBuilder();
  for (byte b : hash) {
    result.append(String.format("%02x", b));
  }

  return result.toString();
}

/**
 * Returns the result of normalizing and hashing an email address. For this use case, Google Ads
 * requires removal of any '.' characters or trailing '+' and characters that follow it from the
 * username portion of the email address if the domain is {@code gmail.com} or {@code
 * googlemail.com}.
 *
 * @param digest the digest to use to hash the normalized string.
 * @param emailAddress the email address to normalize and hash.
 */
private String normalizeAndHashEmailAddress(MessageDigest digest, String emailAddress)
    throws UnsupportedEncodingException {
  // Removes all whitespace (leading, trailing, and intermediate) from the email address.
  String normalizedEmail = emailAddress.toLowerCase().replaceAll("\\s+", "");
  String[] emailParts = normalizedEmail.split("@", 2);
  if (emailParts.length == 2 && emailParts[1].matches("^(gmail|googlemail)\\.com$")) {
    // Removes any '.' characters from the portion of the email address before the domain if the
    // domain is gmail.com or googlemail.com.
    emailParts[0] = emailParts[0].replaceAll("\\.", "");
    // Removes any '+' and all characters that follow it from the portion of the email address
    // before the domain if the domain is gmail.com or googlemail.com.
    emailParts[0] = emailParts[0].replaceAll("\\+.*", "");
    normalizedEmail = String.format("%s@%s", emailParts[0], emailParts[1]);
  }
  return normalizeAndHash(digest, normalizedEmail);
}

/**
 * Returns the result of normalizing and hashing a phone number. For this use case, Google Ads
 * requires phone numbers to be in E.164 format.
 *
 * @param digest the digest to use to hash the normalized string.
 * @param phoneNumber the phone number to normalize and hash.
 */
private String normalizeAndHashPhoneNumber(MessageDigest digest, String phoneNumber)
    throws UnsupportedEncodingException {
  // Removes non-digit characters and prepends a leading '+' sign.
  String digitsOnly = phoneNumber.replaceAll("[^0-9]", "");
  String formattedPhone = "+" + digitsOnly;
  if (!formattedPhone.matches("^\\+[1-9]\\d{6,14}$")) {
    throw new IllegalArgumentException("Phone number must be in E.164 format: " + phoneNumber);
  }
  return normalizeAndHash(digest, formattedPhone);
}
      

সি#

/// <summary>
/// Normalizes the email address and hashes it. For this use case, Google Ads requires
/// removal of any '.' characters preceding <code>gmail.com</code> or
/// <code>googlemail.com</code>.
/// </summary>
/// <param name="emailAddress">The email address.</param>
/// <returns>The hash code.</returns>
private string NormalizeAndHashEmailAddress(string emailAddress)
{
    string normalizedEmail = emailAddress.ToLower();
    string[] emailParts = normalizedEmail.Split('@');
    if (emailParts.Length > 1 && (emailParts[1] == "gmail.com" ||
        emailParts[1] == "googlemail.com"))
    {
        // Removes any '.' characters from the portion of the email address before
        // the domain if the domain is gmail.com or googlemail.com.
        emailParts[0] = emailParts[0].Replace(".", "");
        normalizedEmail = $"{emailParts[0]}@{emailParts[1]}";
    }
    return NormalizeAndHash(normalizedEmail);
}

/// <summary>
/// Normalizes and hashes a string value.
/// </summary>
/// <param name="value">The value to normalize and hash.</param>
/// <returns>The normalized and hashed value.</returns>
private static string NormalizeAndHash(string value)
{
    return ToSha256String(digest, ToNormalizedValue(value));
}

/// <summary>
/// Hash a string value using SHA-256 hashing algorithm.
/// </summary>
/// <param name="digest">Provides the algorithm for SHA-256.</param>
/// <param name="value">The string value (e.g. an email address) to hash.</param>
/// <returns>The hashed value.</returns>
private static string ToSha256String(SHA256 digest, string value)
{
    byte[] digestBytes = digest.ComputeHash(Encoding.UTF8.GetBytes(value));
    // Convert the byte array into an unhyphenated hexadecimal string.
    return BitConverter.ToString(digestBytes).Replace("-", string.Empty);
}

/// <summary>
/// Removes leading and trailing whitespace and converts all characters to
/// lower case.
/// </summary>
/// <param name="value">The value to normalize.</param>
/// <returns>The normalized value.</returns>
private static string ToNormalizedValue(string value)
{
    return value.Trim().ToLower();
}
      

পিএইচপি

private static function normalizeAndHash(string $hashAlgorithm, string $value): string
{
    // Normalizes by first converting all characters to lowercase, then trimming spaces.
    $normalized = strtolower($value);
    // Removes leading, trailing, and intermediate spaces.
    $normalized = str_replace(' ', '', $normalized);
    return hash($hashAlgorithm, strtolower(trim($normalized)));
}

/**
 * Returns the result of normalizing and hashing an email address. For this use case, Google
 * Ads requires removal of any '.' characters preceding "gmail.com" or "googlemail.com".
 *
 * @param  string $hashAlgorithm the hash algorithm to use
 * @param  string $emailAddress  the email address to normalize and hash
 * @return string the normalized and hashed email address
 */
private static function normalizeAndHashEmailAddress(
    string $hashAlgorithm,
    string $emailAddress
): string {
    $normalizedEmail = strtolower($emailAddress);
    $emailParts = explode("@", $normalizedEmail);
    if (
        count($emailParts) > 1
        && preg_match('/^(gmail|googlemail)\.com\s*/', $emailParts[1])
    ) {
        // Removes any '.' characters from the portion of the email address before the domain
        // if the domain is gmail.com or googlemail.com.
        $emailParts[0] = str_replace(".", "", $emailParts[0]);
        $normalizedEmail = sprintf('%s@%s', $emailParts[0], $emailParts[1]);
    }
    return self::normalizeAndHash($hashAlgorithm, $normalizedEmail);
}
      

পাইথন

def normalize_and_hash_email_address(email_address: str) -> str:
    """Returns the result of normalizing and hashing an email address.

    For this use case, Google Ads requires removal of any '.' characters
    preceding "gmail.com" or "googlemail.com"

    Args:
        email_address: An email address to normalize.

    Returns:
        A normalized (lowercase, removed whitespace) and SHA-265 hashed string.
    """
    normalized_email: str = email_address.strip().lower()
    email_parts: list[str] = normalized_email.split("@")

    # Check that there are at least two segments
    if len(email_parts) > 1:
        # Removes any '.' and '+' characters from the portion of the email address
        # before the domain
        chars_to_remove = ".+"
        translation_table = str.maketrans("", "", chars_to_remove)
        email_parts[0] = email_parts[0].translate(translation_table)
        normalized_email = "@".join(email_parts)

    return normalize_and_hash(normalized_email)


def normalize_and_hash(s: str) -> str:
    """Normalizes and hashes a string with SHA-256.

    Private customer data must be hashed during upload, as described at:
    https://support.google.com/google-ads/answer/7474263

    Args:
        s: The string to perform this operation on.

    Returns:
        A normalized (lowercase, removed whitespace) and SHA-256 hashed string.
    """
    return hashlib.sha256(s.strip().lower().encode()).hexdigest()
      

রুবি

# Returns the result of normalizing and then hashing the string using the
# provided digest.  Private customer data must be hashed during upload, as
# described at https://support.google.com/google-ads/answer/7474263.
def normalize_and_hash(str)
  # Remove leading and trailing whitespace and ensure all letters are lowercase
  # before hashing.
  Digest::SHA256.hexdigest(str.strip.downcase)
end

# Returns the result of normalizing and hashing an email address. For this use
# case, Google Ads requires removal of any '.' characters preceding 'gmail.com'
# or 'googlemail.com'.
def normalize_and_hash_email(email)
  email_parts = email.downcase.split("@")
  # Removes any '.' characters from the portion of the email address before the
  # domain if the domain is gmail.com or googlemail.com.
  if email_parts.last =~ /^(gmail|googlemail)\.com\s*/
    email_parts[0] = email_parts[0].gsub('.', '')
  end
  normalize_and_hash(email_parts.join('@'))
end
      

পার্ল

sub normalize_and_hash {
  my $value = shift;

  # Removes leading, trailing, and intermediate spaces.
  $value =~ s/\s+//g;
  return sha256_hex(lc $value);
}

# Returns the result of normalizing and hashing an email address. For this use
# case, Google Ads requires removal of any '.' characters preceding 'gmail.com'
# or 'googlemail.com'.
sub normalize_and_hash_email_address {
  my $email_address = shift;

  my $normalized_email = lc $email_address;
  my @email_parts      = split('@', $normalized_email);
  if (scalar @email_parts > 1
    && $email_parts[1] =~ /^(gmail|googlemail)\.com\s*/)
  {
    # Remove any '.' characters from the portion of the email address before the
    # domain if the domain is 'gmail.com' or 'googlemail.com'.
    $email_parts[0] =~ s/\.//g;
    $normalized_email = sprintf '%s@%s', $email_parts[0], $email_parts[1];
  }
  return normalize_and_hash($normalized_email);
}
      

কার্ল

ClickConversion অবজেক্টগুলি পূরণ করুন

আপনার UploadClickConversionRequest এ থাকা ClickConversion অবজেক্টগুলোর সংগ্রহটি সেই কনভার্সনগুলোর সেটকে উপস্থাপন করে যা আপনি ইম্পোর্ট করতে চান। ClickConversion অবজেক্ট তৈরি করার সময় নিম্নলিখিত বিবরণগুলো মনে রাখবেন:

gclid

যখন কোনো ব্যক্তি আপনার বিজ্ঞাপনে ক্লিক করে আপনার ওয়েবসাইটে প্রবেশ করে, তখন ইউআরএল প্যারামিটার থেকে GCLID-গুলো সংগ্রহ করা হয়।

gbraid

gbraid হলো একটি URL প্যারামিটার, যা তখন উপস্থিত থাকে যখন কোনো ব্যবহারকারী ওয়েবে কোনো বিজ্ঞাপনে ক্লিক করে আপনার iOS অ্যাপে চলে যান।

wbraid

wbraid হলো একটি URL প্যারামিটার, যা তখন উপস্থিত থাকে যখন কোনো ব্যবহারকারী একটি iOS অ্যাপে কোনো বিজ্ঞাপনে ক্লিক করে আপনার ওয়েবপেজে চলে যান।

cart_data

একটি কনভার্সন সম্পর্কিত আইটেম-স্তরের বিবরণ এতে থাকে। গুগল অ্যাডস UI-তে বাস্কেট ডেটা—যেমন কেনা আইটেম, মূল্য এবং পরিমাণ—সম্পর্কে রিপোর্ট করার জন্য cart_data ফিল্ডটি পূরণ করা আবশ্যক। প্রয়োজনীয় কাঠামোর জন্য CartData অবজেক্টের সংজ্ঞা দেখুন এবং কার্ট ডেটা দিয়ে কনভার্সন সম্পর্কে আরও জানুন।

user_identifiers

লিডের জন্য এনহ্যান্সড কনভার্সন ব্যবহার করার সময়, আপনাকে অবশ্যই ইউজার-প্রদত্ত নর্মালাইজড এবং হ্যাশ করা ডেটা দিয়ে user_identifiers ফিল্ডটি পূরণ করতে হবে। যদি আপনার একাধিক ইউজার আইডেন্টিফায়ার থাকে, তবে প্রতিটির জন্য একটি করে আলাদা UserIdentifier তৈরি করুন, সর্বোচ্চ পাঁচটি আইডেন্টিফায়ার পর্যন্ত।

conversion_date_time

রূপান্তরের তারিখ ও সময়।

মানটিতে অবশ্যই একটি টাইমজোন উল্লেখ করা থাকতে হবে এবং এর ফরম্যাটটি yyyy-mm-dd HH:mm:ss+|-HH:mm হতে হবে, উদাহরণস্বরূপ: 2022-01-01 19:32:45-05:00 (ডেলাইট সেভিং টাইম উপেক্ষা করে)।

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

conversion_action

অফলাইন রূপান্তরের জন্য ConversionAction এর রিসোর্স নাম।

কনভার্সন অ্যাকশনটির type অবশ্যই UPLOAD_CLICKS হতে হবে এবং ক্লিকটির সাথে যুক্ত Google Ads অ্যাকাউন্টের Google Ads কনভার্সন কাস্টমারে এটি বিদ্যমান থাকতে হবে।

conversion_value

রূপান্তরের মান।

currency_code

conversion_value এর মুদ্রা কোড

consent

ClickConversion অবজেক্টের consent ফিল্ডটি পূরণ করার জন্য বিশেষভাবে সুপারিশ করা হচ্ছে। এটি সেট করা না থাকলে, আপনার কনভার্সনগুলো অ্যাট্রিবিউটেবল নাও হতে পারে।

order_id

এটি কনভার্সনের ট্রানজ্যাকশন আইডি হিসেবেও পরিচিত। এই ফিল্ডটি ঐচ্ছিক, কিন্তু এটি সেট করার জন্য জোরালোভাবে সুপারিশ করা হয়, কারণ অ্যাডজাস্টমেন্ট করার সময় এটি ইম্পোর্ট করা কনভার্সনগুলোকে রেফারেন্স করা সহজ করে তোলে। ইম্পোর্টের সময় যদি আপনি এটি সেট করেন, তবে যেকোনো অ্যাডজাস্টমেন্টের জন্য আপনাকে অবশ্যই এটি ব্যবহার করতে হবে। ডুপ্লিকেট কনভার্সন কমানোর জন্য কীভাবে ট্রানজ্যাকশন আইডি ব্যবহার করতে হয় সে সম্পর্কে আরও জানতে, এই হেল্প সেন্টার আর্টিকেলটি দেখুন।

custom_variables

কাস্টম রূপান্তর ভেরিয়েবলগুলোর মান।

Google Ads, wbraid বা gbraid সাথে কাস্টম কনভার্সন ভ্যারিয়েবল ব্যবহার সমর্থন করে না।

conversion_environment

যে পরিবেশে এই রূপান্তরটি রেকর্ড করা হয়েছিল তা নির্দেশ করে। উদাহরণস্বরূপ, APP বা WEB

session_attributes_encoded এবং session_attributes_key_value_pairs

সেশন অ্যাট্রিবিউট হলো সমষ্টিগত শনাক্তকারী যা কনভার্সন অ্যাট্রিবিউশনের জন্য ব্যবহৃত হয়। এগুলো GCLID, URL প্যারামিটার (যেমন GBRAID) এবং ব্যবহারকারীর দেওয়া ডেটার পাশাপাশি কাজ করে, যা লিডদের জন্য উন্নত কনভার্সনের কেন্দ্রবিন্দু। সেশন অ্যাট্রিবিউট ইম্পোর্ট করার দুটি উপায় আছে: ব্রাউজারে আমাদের জাভাস্ক্রিপ্ট কোড দ্বারা তৈরি এনকোডেড টোকেন প্রদান করে, অথবা প্রতিটি শনাক্তকারীর জন্য আলাদা কী-ভ্যালু পেয়ার প্রদান করে।

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

জাভা

// Sets one of the sessionAttributesEncoded or sessionAttributesKeyValuePairs if either is
// provided. The session attribute fields are only available to allowlisted users.
// To include these fields in conversion imports, upgrade to the Data Manager API.
if (rawRecord.containsKey("sessionAttributesEncoded")) {
  clickConversionBuilder.setSessionAttributesEncoded(
      ByteString.copyFromUtf8(rawRecord.get("sessionAttributesEncoded")));
} else if (rawRecord.containsKey("sessionAttributesMap")) {
  List<String> pairings =
      Arrays.stream(rawRecord.get("sessionAttributesMap").split(" "))
          .map(String::trim)
          .collect(Collectors.toList());
  SessionAttributesKeyValuePairs.Builder sessionAttributePairs =
      SessionAttributesKeyValuePairs.newBuilder();
  for (String pair : pairings) {
    String[] parts = pair.split("=", 2);
    if (parts.length != 2) {
      throw new IllegalArgumentException(
          "Failed to read the sessionAttributesMap. SessionAttributesMap must use a"
              + " space-delimited list of session attribute key value pairs. Each pair should"
              + " be separated by an equal sign, for example: 'gad_campaignid=12345"
              + " gad_source=1'");
    }
    sessionAttributePairs.addKeyValuePairs(
        SessionAttributeKeyValuePair.newBuilder()
            .setSessionAttributeKey(parts[0])
            .setSessionAttributeValue(parts[1])
            .build());
  }
  clickConversionBuilder.setSessionAttributesKeyValuePairs(sessionAttributePairs.build());
}
      

সি#

// The session attribute fields are only available to allowlisted users. To
// include these fields in conversion imports, upgrade to the Data Manager API.
if (!string.IsNullOrEmpty(sessionAttributesEncoded))
{
    clickConversion.SessionAttributesEncoded =
        ByteString.CopyFrom(sessionAttributesEncoded, Encoding.Unicode);
}
else if (!string.IsNullOrEmpty(sessionAttributes))
{
    IEnumerable<SessionAttributeKeyValuePair> parsedSessionAttributes =
        sessionAttributes.Split(';').Select(pair => {
            string[] split = pair.Split('=');
            return new SessionAttributeKeyValuePair()
            {
                SessionAttributeKey = split[0],
                SessionAttributeValue = split[1]
            };
        });

    clickConversion.SessionAttributesKeyValuePairs =
        new SessionAttributesKeyValuePairs();
    clickConversion.SessionAttributesKeyValuePairs.KeyValuePairs
        .AddRange(parsedSessionAttributes);
}
      

পিএইচপি

This example is not yet available in PHP; you can take a look at the other languages.
    

পাইথন

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded:
    click_conversion.session_attributes_encoded = session_attributes_encoded
elif session_attributes_dict:
    for key, value in session_attributes_dict.items():
        pair: SessionAttributeKeyValuePair = client.get_type(
            "SessionAttributeKeyValuePair"
        )
        pair.session_attribute_key = key
        pair.session_attribute_value = value
        click_conversion.session_attributes_key_value_pairs.key_value_pairs.append(
            pair
        )
      

রুবি

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded != nil
  cc.class.module_eval { attr_accessor :session_attributes_encoded}
  cc.session_attributes_encoded = session_attributes_encoded
elsif session_attributes_hash != nil
  # Add new attribute to click conversion object
  cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
  cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

  # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
  session_attributes_hash.each do |key, value|
    pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
    pair.session_attribute_key = key
    pair.session_attribute_value = value
    cc.session_attributes_key_value_pairs.key_value_pairs << pair
  end
end    
      

পার্ল

# Set one of the session_attributes_encoded or session_attributes_key_value_pairs
# fields if either are provided.
if (defined $session_attributes_encoded) {
  $click_conversion->{sessionAttributesEncoded} = $session_attributes_encoded;
} elsif (defined $session_attributes_hash) {
  while (my ($key, $value) = each %$session_attributes_hash) {
    my $pair =
      Google::Ads::GoogleAds::V25::Services::ConversionUploadService::SessionAttributeKeyValuePair
      ->new({sessionAttributeKey => $key, sessionAttributeValue => $value});
    push @{$click_conversion->{sessionAttributesKeyValuePairs}{keyValuePairs}
    }, $pair;
  }
}
      

কার্ল

user_ip_address

বিজ্ঞাপনে ক্লিক করার পর এবং কোনো কনভার্সন ইভেন্টের আগে, গ্রাহক যখন ল্যান্ডিং পেজে আসেন, তখনকার আইপি অ্যাড্রেস। এটি গ্রাহকের ডিভাইসের আইপি অ্যাড্রেস, বিজ্ঞাপনদাতার সার্ভারের নয়।

এই ফিল্ডটি হলো একটি স্ট্রিং যা IPv4 অথবা IPv6 ফরম্যাটে একটি আইপি অ্যাড্রেসকে উপস্থাপন করে। উদাহরণস্বরূপ:

  • IPv4: "192.0.2.0"
  • IPv6: "2001:0DB8:1234:5678:9999:1111:0000:0001"

কোডের উদাহরণ

এই উদাহরণটি দেখায় কিভাবে আপনার নর্মালাইজড এবং হ্যাশ করা ব্যবহারকারী-প্রদত্ত ডেটা একটি ClickConversion অবজেক্টে সেট করতে হয়।

জাভা

// Creates an empty builder for constructing the click conversion.
ClickConversion.Builder clickConversionBuilder = ClickConversion.newBuilder();

// Extracts user email and phone from the raw data, normalizes and hashes it, then wraps it in
// UserIdentifier objects.
// Creates a separate UserIdentifier object for each. The data in this example is hardcoded, but
// in your application you might read the raw data from an input file.

// IMPORTANT: Since the identifier attribute of UserIdentifier
// (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier) is a
// oneof
// (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set only ONE of
// hashedEmail, hashedPhoneNumber, mobileId, thirdPartyUserId, or addressInfo. Setting more
// than one of these attributes on the same UserIdentifier will clear all the other members
// of the oneof. For example, the following code is INCORRECT and will result in a
// UserIdentifier with ONLY a hashedPhoneNumber.
//
// UserIdentifier incorrectlyPopulatedUserIdentifier =
//     UserIdentifier.newBuilder()
//         .setHashedEmail("...")
//         .setHashedPhoneNumber("...")
//         .build();

ImmutableMap.Builder<String, String> rawRecordBuilder =
    ImmutableMap.<String, String>builder()
        .put("email", "alex.2+myalias@gmail.com")
        // Phone number to be converted to E.164 format, with a leading '+' as required.
        .put("phone", "+1 (800) 555-0102")
        // This example lets you put conversion details as arguments, but in reality you might
        // store this data alongside other user data, so we include it in this sample user
        // record.
        .put("conversionActionId", Long.toString(conversionActionId))
        .put("conversionDateTime", conversionDateTime)
        .put("conversionValue", Double.toString(conversionValue))
        .put("currencyCode", "USD");

// Adds entries for the optional fields.
if (orderId != null) {
  rawRecordBuilder.put("orderId", orderId);
}
if (gclid != null) {
  rawRecordBuilder.put("gclid", gclid);
}
if (adUserDataConsent != null) {
  rawRecordBuilder.put("adUserDataConsent", adUserDataConsent.name());
}
if (sessionAttributesEncoded != null) {
  rawRecordBuilder.put("sessionAttributesEncoded", sessionAttributesEncoded);
}
if (sessionAttributesMap != null) {
  rawRecordBuilder.put("sessionAttributesMap", sessionAttributesMap);
}

// Builds the map representing the record.
Map<String, String> rawRecord = rawRecordBuilder.build();

// Creates a SHA256 message digest for hashing user identifiers in a privacy-safe way, as
// described at https://support.google.com/google-ads/answer/9888656.
MessageDigest sha256Digest = MessageDigest.getInstance("SHA-256");

// Creates a list for the user identifiers.
List<UserIdentifier> userIdentifiers = new ArrayList<>();

// Creates a user identifier using the hashed email address, using the normalize and hash method
// specifically for email addresses.
UserIdentifier emailIdentifier =
    UserIdentifier.newBuilder()
        // Optional: specify the user identifier source.
        .setUserIdentifierSource(UserIdentifierSource.FIRST_PARTY)
        // Uses the normalize and hash method specifically for email addresses.
        .setHashedEmail(normalizeAndHashEmailAddress(sha256Digest, rawRecord.get("email")))
        .build();
userIdentifiers.add(emailIdentifier);

// Creates a user identifier using normalized and hashed phone info.
UserIdentifier hashedPhoneNumberIdentifier =
    UserIdentifier.newBuilder()
        .setHashedPhoneNumber(normalizeAndHashPhoneNumber(sha256Digest, rawRecord.get("phone")))
        .build();
// Adds the hashed phone number identifier to the UserData object's list.
userIdentifiers.add(hashedPhoneNumberIdentifier);

// Adds the user identifiers to the conversion.
clickConversionBuilder.addAllUserIdentifiers(userIdentifiers);
      

সি#

// Adds a user identifier using the hashed email address, using the normalize
// and hash method specifically for email addresses.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    HashedEmail = NormalizeAndHashEmailAddress("alex.2@example.com"),
    // Optional: Specifies the user identifier source.
    UserIdentifierSource = UserIdentifierSource.FirstParty
});

// Adds a user identifier using normalized and hashed phone info.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    HashedPhoneNumber = NormalizeAndHash("+1 800 5550102"),
    // Optional: Specifies the user identifier source.
    UserIdentifierSource = UserIdentifierSource.FirstParty
});

// Adds a user identifier with all the required mailing address elements.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    AddressInfo = new OfflineUserAddressInfo()
    {
        // FirstName and LastName must be normalized and hashed.
        HashedFirstName = NormalizeAndHash("Alex"),
        HashedLastName = NormalizeAndHash("Quinn"),
        // CountryCode and PostalCode are sent in plain text.
        CountryCode = "US",
        PostalCode = "94045"
    }
});
      

পিএইচপি

// Creates a click conversion with the specified attributes.
$clickConversion = new ClickConversion();

// Extract user email and phone from the raw data, normalize and hash it, then wrap it in
// UserIdentifier objects. Creates a separate UserIdentifier object for each.
// The data in this example is hardcoded, but in your application you might read the raw
// data from an input file.

// IMPORTANT: Since the identifier attribute of UserIdentifier
// (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier) is a
// oneof
// (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set only ONE
// of hashedEmail, hashedPhoneNumber, mobileId, thirdPartyUserId, or addressInfo. Setting
// more than one of these attributes on the same UserIdentifier will clear all the other
// members of the oneof. For example, the following code is INCORRECT and will result in a
// UserIdentifier with ONLY a hashedPhoneNumber.
//
// $incorrectlyPopulatedUserIdentifier = new UserIdentifier([
//    'hashed_email' => '...',
//    'hashed_phone_number' => '...'
// ]);

$rawRecord = [
    // Email address that includes a period (.) before the Gmail domain.
    'email' => 'alex.2@example.com',
    // Phone number to be converted to E.164 format, with a leading '+' as required.
    'phone' => '+1 800 5550102',
    // This example lets you input conversion details as arguments, but in reality you might
    // store this data alongside other user data, so we include it in this sample user
    // record.
    'orderId' => $orderId,
    'gclid' => $gclid,
    'conversionActionId' => $conversionActionId,
    'conversionDateTime' => $conversionDateTime,
    'conversionValue' => $conversionValue,
    'currencyCode' => 'USD',
    'adUserDataConsent' => $adUserDataConsent,
    'sessionAttributesEncoded' => $sessionAttributesEncoded,
    'sessionAttributesDict' => $sessionAttributesDict
];

// Creates a list for the user identifiers.
$userIdentifiers = [];

// Uses the SHA-256 hash algorithm for hashing user identifiers in a privacy-safe way, as
// described at https://support.google.com/google-ads/answer/9888656.
$hashAlgorithm = "sha256";

// Creates a user identifier using the hashed email address, using the normalize and hash
// method specifically for email addresses.
$emailIdentifier = new UserIdentifier(
    [
    // Uses the normalize and hash method specifically for email addresses.
    'hashed_email' => self::normalizeAndHashEmailAddress(
        $hashAlgorithm,
        $rawRecord['email']
    ),
    // Optional: Specifies the user identifier source.
    'user_identifier_source' => UserIdentifierSource::FIRST_PARTY
    ]
);
$userIdentifiers[] = $emailIdentifier;

// Checks if the record has a phone number, and if so, adds a UserIdentifier for it.
if (array_key_exists('phone', $rawRecord)) {
    $hashedPhoneNumberIdentifier = new UserIdentifier(
        [
        'hashed_phone_number' => self::normalizeAndHash(
            $hashAlgorithm,
            $rawRecord['phone'],
            true
        )
        ]
    );
    // Adds the hashed email identifier to the user identifiers list.
    $userIdentifiers[] = $hashedPhoneNumberIdentifier;
}

// Adds the user identifiers to the conversion.
$clickConversion->setUserIdentifiers($userIdentifiers);
      

পাইথন

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each. The data in this example is hardcoded, but in your
# application you might read the raw data from an input file.

# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must
# set only ONE of hashed_email, hashed_phone_number, mobile_id,
# third_party_user_id, or address_info. Setting more than one of these
# attributes on the same UserIdentifier will clear all the other members of
# the oneof. For example, the following code is INCORRECT and will result in
# a UserIdentifier with ONLY a hashed_phone_number:
#
# incorrectly_populated_user_identifier = client.get_type("UserIdentifier")
# incorrectly_populated_user_identifier.hashed_email = "...""
# incorrectly_populated_user_identifier.hashed_phone_number = "...""

raw_record: Dict[str, Union[str, float]] = {
    # Email address that includes a period (.) before the Gmail domain.
    "email": "alex.2@example.com",
    # Phone number to be converted to E.164 format, with a leading '+' as
    # required.
    "phone": "+1 800 5550102",
    # This example lets you input conversion details as arguments,
    # but in reality you might store this data alongside other user data,
    # so we include it in this sample user record.
    "order_id": order_id,
    "gclid": gclid,
    "conversion_action_id": conversion_action_id,
    "conversion_date_time": conversion_date_time,
    "conversion_value": conversion_value,
    "currency_code": "USD",
    "ad_user_data_consent": ad_user_data_consent,
}

# Constructs the click conversion.
click_conversion: ClickConversion = client.get_type("ClickConversion")
# Creates a user identifier using the hashed email address, using the
# normalize and hash method specifically for email addresses.
email_identifier: UserIdentifier = client.get_type("UserIdentifier")
# Optional: Specifies the user identifier source.
email_identifier.user_identifier_source = (
    client.enums.UserIdentifierSourceEnum.FIRST_PARTY
)
# Uses the normalize and hash method specifically for email addresses.
email_identifier.hashed_email = normalize_and_hash_email_address(
    raw_record["email"]
)
# Adds the user identifier to the conversion.
click_conversion.user_identifiers.append(email_identifier)

# Checks if the record has a phone number, and if so, adds a UserIdentifier
# for it.
if raw_record.get("phone") is not None:
    phone_identifier: UserIdentifier = client.get_type("UserIdentifier")
    phone_identifier.hashed_phone_number = normalize_and_hash(
        raw_record["phone"]
    )
    # Adds the phone identifier to the conversion adjustment.
    click_conversion.user_identifiers.append(phone_identifier)
      

রুবি

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each. The data in this example is hardcoded, but in your
# application you might read the raw data from an input file.

# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must
# set only ONE of hashed_email, hashed_phone_number, mobile_id,
# third_party_user_id, or address_info. Setting more than one of these
# attributes on the same UserIdentifier will clear all the other members of
# the oneof. For example, the following code is INCORRECT and will result in
# a UserIdentifier with ONLY a hashed_phone_number:
#
# incorrectly_populated_user_identifier.hashed_email = "...""
# incorrectly_populated_user_identifier.hashed_phone_number = "...""

raw_record = {
  # Email address that includes a period (.) before the Gmail domain.
  "email" => "alex.2@example.com",
  # Phone number to be converted to E.164 format, with a leading '+' as
  # required.
  "phone" => "+1 800 5550102",
  # This example lets you input conversion details as arguments,
  # but in reality you might store this data alongside other user data,
  # so we include it in this sample user record.
  "order_id" => order_id,
  "gclid" => gclid,
  "conversion_action_id" => conversion_action_id,
  "conversion_date_time" => conversion_date_time,
  "conversion_value" => conversion_value,
  "currency_code" => "USD",
  "ad_user_data_consent" => ad_user_data_consent,
  "session_attributes_encoded" => session_attributes_encoded,
  "session_attributes_hash" => session_attributes_hash
}

click_conversion = client.resource.click_conversion do |cc|
  cc.conversion_action = client.path.conversion_action(customer_id, conversion_action_id)
  cc.conversion_date_time = conversion_date_time
  cc.conversion_value = conversion_value.to_f
  cc.currency_code = 'USD'

  unless order_id.nil?
    cc.order_id = order_id
  end

  unless raw_record["gclid"].nil?
    cc.gclid = gclid
  end

  # Specifies whether user consent was obtained for the data you are
  # uploading. For more details, see:
  # https://www.google.com/about/company/user-consent-policy
  unless raw_record["ad_user_data_consent"].nil?
    cc.consent = client.resource.consent do |c|
      c.ad_user_data = ad_user_data_consent
    end
  end

  # Set one of the session_attributes_encoded or
  # session_attributes_key_value_pairs fields if either are provided.
  # The session attribute fields are only available to allowlisted users.
  # To include these fields in conversion imports, upgrade to the Data Manager API.
  if session_attributes_encoded != nil
    cc.class.module_eval { attr_accessor :session_attributes_encoded}
    cc.session_attributes_encoded = session_attributes_encoded
  elsif session_attributes_hash != nil
    # Add new attribute to click conversion object
    cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
    cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

    # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
    session_attributes_hash.each do |key, value|
      pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
      pair.session_attribute_key = key
      pair.session_attribute_value = value
      cc.session_attributes_key_value_pairs.key_value_pairs << pair
    end
  end    

  # Creates a user identifier using the hashed email address, using the
  # normalize and hash method specifically for email addresses.
  # If using a phone number, use the normalize_and_hash method instead.
  cc.user_identifiers << client.resource.user_identifier do |ui|
    ui.hashed_email = normalize_and_hash_email(raw_record["email"])
    # Optional: Specifies the user identifier source.
    ui.user_identifier_source = :FIRST_PARTY
  end

  # Checks if the record has a phone number, and if so, adds a UserIdentifier
  # for it.
  unless raw_record["phone"].nil?
    cc.user_identifiers << client.resource.user_identifier do |ui|
      ui.hashed_phone_number = normalize_and_hash(raw_record["phone"])
    end
  end
end
      

পার্ল

# Create an empty click conversion.
my $click_conversion =
  Google::Ads::GoogleAds::V25::Services::ConversionUploadService::ClickConversion
  ->new({});

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each.
# The data in this example is hardcoded, but in your application
# you might read the raw data from an input file.
#
# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set
# only ONE of hashed_email, hashed_phone_number, mobile_id, third_party_user_id,
# or address-info. Setting more than one of these attributes on the same UserIdentifier
# will clear all the other members of the oneof. For example, the following code is
# INCORRECT and will result in a UserIdentifier with ONLY a hashed_phone_number:
#
# my $incorrect_user_identifier = Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
#   hashedEmail => '...',
#   hashedPhoneNumber => '...',
# });
my $raw_record = {
  # Email address that includes a period (.) before the Gmail domain.
  email => 'alex.2@example.com',
  # Phone number to be converted to E.164 format, with a leading '+' as
  # required.
  phone => '+1 800 5550102',
  # This example lets you input conversion details as arguments,
  # but in reality you might store this data alongside other user data,
  # so we include it in this sample user record.
  orderId            => $order_id,
  gclid              => $gclid,
  conversionActionId => $conversion_action_id,
  conversionDateTime => $conversion_date_time,
  conversionValue    => $conversion_value,
  currencyCode       => "USD",
  adUserDataConsent  => $ad_user_data_consent
};
my $user_identifiers = [];

# Create a user identifier using the hashed email address, using the normalize
# and hash method specifically for email addresses.
my $hashed_email = normalize_and_hash_email_address($raw_record->{email});
push(
  @$user_identifiers,
  Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
      hashedEmail => $hashed_email,
      # Optional: Specify the user identifier source.
      userIdentifierSource => FIRST_PARTY
    }));

# Create a user identifier using normalized and hashed phone info.
my $hashed_phone = normalize_and_hash($raw_record->{phone});
push(
  @$user_identifiers,
  Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
      hashedPhone => $hashed_phone,
      # Optional: Specify the user identifier source.
      userIdentifierSource => FIRST_PARTY
    }));

# Add the user identifiers to the conversion.
$click_conversion->{userIdentifiers} = $user_identifiers;
      

কার্ল

এই উদাহরণটি দেখায় কিভাবে একটি ClickConversion অবজেক্টে অন্যান্য প্রয়োজনীয় ফিল্ড সেট করতে হয়।

জাভা

// Adds details of the conversion.
clickConversionBuilder.setConversionAction(
    ResourceNames.conversionAction(
        customerId, Long.parseLong(rawRecord.get("conversionActionId"))));
clickConversionBuilder.setConversionDateTime(rawRecord.get("conversionDateTime"));
clickConversionBuilder.setConversionValue(Double.parseDouble(rawRecord.get("conversionValue")));
clickConversionBuilder.setCurrencyCode(rawRecord.get("currencyCode"));

// Sets the order ID if provided.
if (rawRecord.containsKey("orderId")) {
  clickConversionBuilder.setOrderId(rawRecord.get("orderId"));
}

// Sets the Google click ID (gclid) if provided.
if (rawRecord.containsKey("gclid")) {
  clickConversionBuilder.setGclid(rawRecord.get("gclid"));
}

// Sets the consent information, if provided.
if (rawRecord.containsKey("adUserDataConsent")) {
  // Specifies whether user consent was obtained for the data you are uploading. See
  // https://www.google.com/about/company/user-consent-policy for details.
  clickConversionBuilder.setConsent(
      Consent.newBuilder()
          .setAdUserData(ConsentStatus.valueOf(rawRecord.get("adUserDataConsent"))));
}

// Sets one of the sessionAttributesEncoded or sessionAttributesKeyValuePairs if either is
// provided. The session attribute fields are only available to allowlisted users.
// To include these fields in conversion imports, upgrade to the Data Manager API.
if (rawRecord.containsKey("sessionAttributesEncoded")) {
  clickConversionBuilder.setSessionAttributesEncoded(
      ByteString.copyFromUtf8(rawRecord.get("sessionAttributesEncoded")));
} else if (rawRecord.containsKey("sessionAttributesMap")) {
  List<String> pairings =
      Arrays.stream(rawRecord.get("sessionAttributesMap").split(" "))
          .map(String::trim)
          .collect(Collectors.toList());
  SessionAttributesKeyValuePairs.Builder sessionAttributePairs =
      SessionAttributesKeyValuePairs.newBuilder();
  for (String pair : pairings) {
    String[] parts = pair.split("=", 2);
    if (parts.length != 2) {
      throw new IllegalArgumentException(
          "Failed to read the sessionAttributesMap. SessionAttributesMap must use a"
              + " space-delimited list of session attribute key value pairs. Each pair should"
              + " be separated by an equal sign, for example: 'gad_campaignid=12345"
              + " gad_source=1'");
    }
    sessionAttributePairs.addKeyValuePairs(
        SessionAttributeKeyValuePair.newBuilder()
            .setSessionAttributeKey(parts[0])
            .setSessionAttributeValue(parts[1])
            .build());
  }
  clickConversionBuilder.setSessionAttributesKeyValuePairs(sessionAttributePairs.build());
}

// Calls build to build the conversion.
ClickConversion clickConversion = clickConversionBuilder.build();
      

সি#

// Adds details of the conversion.
clickConversion.ConversionAction =
    ResourceNames.ConversionAction(customerId, conversionActionId);
clickConversion.ConversionDateTime = conversionDateTime;
clickConversion.ConversionValue = conversionValue;
clickConversion.CurrencyCode = "USD";

// Sets the order ID if provided.
if (!string.IsNullOrEmpty(orderId))
{
    clickConversion.OrderId = orderId;
}

// Sets the Google click ID (gclid) if provided.
if (!string.IsNullOrEmpty(gclid))
{
    clickConversion.Gclid = gclid;
}

// The session attribute fields are only available to allowlisted users. To
// include these fields in conversion imports, upgrade to the Data Manager API.
if (!string.IsNullOrEmpty(sessionAttributesEncoded))
{
    clickConversion.SessionAttributesEncoded =
        ByteString.CopyFrom(sessionAttributesEncoded, Encoding.Unicode);
}
else if (!string.IsNullOrEmpty(sessionAttributes))
{
    IEnumerable<SessionAttributeKeyValuePair> parsedSessionAttributes =
        sessionAttributes.Split(';').Select(pair => {
            string[] split = pair.Split('=');
            return new SessionAttributeKeyValuePair()
            {
                SessionAttributeKey = split[0],
                SessionAttributeValue = split[1]
            };
        });

    clickConversion.SessionAttributesKeyValuePairs =
        new SessionAttributesKeyValuePairs();
    clickConversion.SessionAttributesKeyValuePairs.KeyValuePairs
        .AddRange(parsedSessionAttributes);
}

      

পিএইচপি

// Adds details of the conversion.
$clickConversion->setConversionAction(
    ResourceNames::forConversionAction($customerId, $rawRecord['conversionActionId'])
);
$clickConversion->setConversionDateTime($rawRecord['conversionDateTime']);
$clickConversion->setConversionValue($rawRecord['conversionValue']);
$clickConversion->setCurrencyCode($rawRecord['currencyCode']);

// Sets the order ID if provided.
if (!empty($rawRecord['orderId'])) {
    $clickConversion->setOrderId($rawRecord['orderId']);
}

// Sets the Google click ID (gclid) if provided.
if (!empty($rawRecord['gclid'])) {
    $clickConversion->setGclid($rawRecord['gclid']);
}

// Sets the ad user data consent if provided.
if (!empty($rawRecord['adUserDataConsent'])) {
    // Specifies whether user consent was obtained for the data you are uploading. See
    // https://www.google.com/about/company/user-consent-policy for details.
    $clickConversion->setConsent(
        new Consent(['ad_user_data' => $rawRecord['adUserDataConsent']])
    );
}

// Set one of the sessionAttributesEncoded or
// SessionAttributeKeyValuePair fields if either are provided. The session attribute
// fields are only available to allowlisted users. To include these fields in conversion
// imports, upgrade to the Data Manager API.
if (!empty($sessionAttributesEncoded)) {
    $clickConversion->setSessionAttributesEncoded($sessionAttributesEncoded);
} elseif (!empty($sessionAttributesDict)) {
    // Create a new container object to hold key-value pairs.
    $sessionAttributesKeyValuePairs = new SessionAttributesKeyValuePairs();
    // Initialize an array to hold individual key-value pair messages.
    $keyValuePairs = [];
    // Append each key-value pair provided to the $keyValuePairs array
    foreach ($sessionAttributesDict as $key => $value) {
        $pair = new SessionAttributeKeyValuePair();
        $pair->setSessionAttributeKey($key);
        $pair->setSessionAttributeValue($value);
        $keyValuePairs[] = $pair;
    }
    // Set the the full list of key-value pairs on the container object.
    $sessionAttributesKeyValuePairs->setKeyValuePairs($keyValuePairs);
    // Attach the container of key-value pairs to the ClickConversion object.
    $clickConversion->setSessionAttributesKeyValuePairs($sessionAttributesKeyValuePairs);
}
      

পাইথন

# Add details of the conversion.
# Gets the conversion action resource name.
conversion_action_service: ConversionActionServiceClient = (
    client.get_service("ConversionActionService")
)
click_conversion.conversion_action = (
    conversion_action_service.conversion_action_path(
        customer_id, raw_record["conversion_action_id"]
    )
)
click_conversion.conversion_date_time = raw_record["conversion_date_time"]
click_conversion.conversion_value = raw_record["conversion_value"]
click_conversion.currency_code = raw_record["currency_code"]

# Sets the order ID if provided.
if raw_record.get("order_id"):
    click_conversion.order_id = raw_record["order_id"]

# Sets the gclid if provided.
if raw_record.get("gclid"):
    click_conversion.gclid = raw_record["gclid"]

# Specifies whether user consent was obtained for the data you are
# uploading. For more details, see:
# https://www.google.com/about/company/user-consent-policy
if raw_record["ad_user_data_consent"]:
    click_conversion.consent.ad_user_data = client.enums.ConsentStatusEnum[
        raw_record["ad_user_data_consent"]
    ]

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded:
    click_conversion.session_attributes_encoded = session_attributes_encoded
elif session_attributes_dict:
    for key, value in session_attributes_dict.items():
        pair: SessionAttributeKeyValuePair = client.get_type(
            "SessionAttributeKeyValuePair"
        )
        pair.session_attribute_key = key
        pair.session_attribute_value = value
        click_conversion.session_attributes_key_value_pairs.key_value_pairs.append(
            pair
        )
      

রুবি

cc.conversion_action = client.path.conversion_action(customer_id, conversion_action_id)
cc.conversion_date_time = conversion_date_time
cc.conversion_value = conversion_value.to_f
cc.currency_code = 'USD'

unless order_id.nil?
  cc.order_id = order_id
end

unless raw_record["gclid"].nil?
  cc.gclid = gclid
end

# Specifies whether user consent was obtained for the data you are
# uploading. For more details, see:
# https://www.google.com/about/company/user-consent-policy
unless raw_record["ad_user_data_consent"].nil?
  cc.consent = client.resource.consent do |c|
    c.ad_user_data = ad_user_data_consent
  end
end

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded != nil
  cc.class.module_eval { attr_accessor :session_attributes_encoded}
  cc.session_attributes_encoded = session_attributes_encoded
elsif session_attributes_hash != nil
  # Add new attribute to click conversion object
  cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
  cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

  # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
  session_attributes_hash.each do |key, value|
    pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
    pair.session_attribute_key = key
    pair.session_attribute_value = value
    cc.session_attributes_key_value_pairs.key_value_pairs << pair
  end
end    
      

পার্ল

# Add details of the conversion.
$click_conversion->{conversionAction} =
  Google::Ads::GoogleAds::V25::Utils::ResourceNames::conversion_action(
  $customer_id, $raw_record->{conversionActionId});
$click_conversion->{conversionDateTime} = $raw_record->{conversionDateTime};
$click_conversion->{conversionValue}    = $raw_record->{conversionValue};
$click_conversion->{currencyCode}       = $raw_record->{currencyCode};

# Set the order ID if provided.
if (defined $raw_record->{orderId}) {
  $click_conversion->{orderId} = $raw_record->{orderId};
}

# Set the Google click ID (gclid) if provided.
if (defined $raw_record->{gclid}) {
  $click_conversion->{gclid} = $raw_record->{gclid};
}

# Set the consent information, if provided.
if (defined $raw_record->{adUserDataConsent}) {
  $click_conversion->{consent} =
    Google::Ads::GoogleAds::V25::Common::Consent->new({
      adUserData => $raw_record->{adUserDataConsent}});
}

# Set one of the session_attributes_encoded or session_attributes_key_value_pairs
# fields if either are provided.
if (defined $session_attributes_encoded) {
  $click_conversion->{sessionAttributesEncoded} = $session_attributes_encoded;
} elsif (defined $session_attributes_hash) {
  while (my ($key, $value) = each %$session_attributes_hash) {
    my $pair =
      Google::Ads::GoogleAds::V25::Services::ConversionUploadService::SessionAttributeKeyValuePair
      ->new({sessionAttributeKey => $key, sessionAttributeValue => $value});
    push @{$click_conversion->{sessionAttributesKeyValuePairs}{keyValuePairs}
    }, $pair;
  }
}
      

কার্ল

অনুরোধটি তৈরি করুন

একবার আপনার ClickConversion অবজেক্টগুলো কনফিগার করে UploadClickConversionRequest অবজেক্টের conversions ফিল্ডে যোগ করা হয়ে গেলে, নিম্নলিখিত ফিল্ডগুলো সেট করুন এবং ConversionUploadService এর UploadClickConversions মেথডে রিকোয়েস্টটি পাঠান।

customer_id
যে অ্যাকাউন্ট থেকে ক্লিকগুলো আসছে, সেটির গুগল অ্যাডস কনভার্সন কাস্টমার -এ এটি সেট করুন। কোন অ্যাকাউন্টটি সঠিক, সে বিষয়ে আপনি নিশ্চিত না হলে, গেটিং স্টার্টেড সেকশনের উদাহরণ কোয়েরিতে থাকা customer.conversion_tracking_setting.google_ads_conversion_customer ফিল্ডটি দেখুন।
job_id

অফলাইন ডেটা ডায়াগনস্টিক্সে প্রতিটি কাজের তথ্যের সাথে আপনার ইম্পোর্ট অনুরোধগুলিকে সংযুক্ত করার একটি পদ্ধতি প্রদান করে।

আপনি যদি এই ফিল্ডটি সেট না করেন, তাহলে Google Ads API প্রতিটি অনুরোধকে [2^31, 2^63) রেঞ্জের মধ্যে একটি অনন্য মান নির্ধারণ করে। আপনি যদি একাধিক অনুরোধকে একটি একক যৌক্তিক কাজে একত্রিত করতে চান, তাহলে আপনার কাজের প্রতিটি অনুরোধে এই ফিল্ডটিকে [0, 2^31) রেঞ্জের মধ্যে একই মানে সেট করুন।

আপনি কোনো মান নির্দিষ্ট করে দিন বা গুগল অ্যাডস এপিআই-কে মান নির্ধারণ করতে দিন, রেসপন্সের job_id তে অনুরোধটির জব আইডি থাকে।

partial_failure

রূপান্তর আমদানি করার সময় এই ফিল্ডটি অবশ্যই ' true সেট করতে হবে। প্রতিক্রিয়া প্রক্রিয়া করার সময় আংশিক ব্যর্থতা সংক্রান্ত নির্দেশিকা অনুসরণ করুন।

অনুরোধটি আমদানি করুন

একবার আপনি আপনার ClickConversion অবজেক্টগুলো পূরণ করে এবং আপনার অনুরোধটি তৈরি করে ফেললে, আপনি আপনার ইম্পোর্টটি জমা দিতে পারেন।

জাভা

// Creates the conversion upload service client.
try (ConversionUploadServiceClient conversionUploadServiceClient =
    googleAdsClient.getLatestVersion().createConversionUploadServiceClient()) {
  // Uploads the click conversion. Partial failure should always be set to true.

  // NOTE: This request contains a single conversion as a demonstration.  However, if you have
  // multiple conversions to upload, it's best to upload multiple conversions per request
  // instead of sending a separate request per conversion. See the following for per-request
  // limits:
  // https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
  UploadClickConversionsResponse response =
      conversionUploadServiceClient.uploadClickConversions(
          UploadClickConversionsRequest.newBuilder()
              .setCustomerId(Long.toString(customerId))
              .addConversions(clickConversion)
              // Enables partial failure (must be true).
              .setPartialFailure(true)
              .build());
      

সি#

// Uploads the click conversion. Partial failure should always be set to true.
// NOTE: This request contains a single conversion as a demonstration.
// However, if you have multiple conversions to upload, it's best to upload multiple
// conversions per request instead of sending a separate request per conversion.
// See the following for per-request limits:
// https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload
UploadClickConversionsResponse response =
    conversionUploadService.UploadClickConversions(
        new UploadClickConversionsRequest()
        {
            CustomerId = customerId.ToString(),
            Conversions = { clickConversion },
            // Enables partial failure (must be true).
            PartialFailure = true
        });

      

পিএইচপি

// Issues a request to upload the click conversion.
$conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();
// NOTE: This request contains a single conversion as a demonstration.  However, if you have
// multiple conversions to upload, it's best to upload multiple conversions per request
// instead of sending a separate request per conversion. See the following for per-request
// limits:
// https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
$response = $conversionUploadServiceClient->uploadClickConversions(
    // Enables partial failure (must be true).
    UploadClickConversionsRequest::build($customerId, [$clickConversion], true)
);
      

পাইথন

# Creates the conversion upload service client.
conversion_upload_service: ConversionUploadServiceClient = (
    client.get_service("ConversionUploadService")
)
# Uploads the click conversion. Partial failure should always be set to
# True.
# NOTE: This request only uploads a single conversion, but if you have
# multiple conversions to upload, it's most efficient to upload them in a
# single request. See the following for per-request limits for reference:
# https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
response: UploadClickConversionsResponse = (
    conversion_upload_service.upload_click_conversions(
        customer_id=customer_id,
        conversions=[click_conversion],
        # Enables partial failure (must be true).
        partial_failure=True,
    )
)
      

রুবি

response = client.service.conversion_upload.upload_click_conversions(
  customer_id: customer_id,
  conversions: [click_conversion],
  # Partial failure must be true.
  partial_failure: true,
)

if response.partial_failure_error
  puts "Partial failure encountered: #{response.partial_failure_error.message}"
else
  result = response.results.first
  puts "Uploaded click conversion that happened at #{result.conversion_date_time} " \
    "to #{result.conversion_action}."
end
      

পার্ল

# Upload the click conversion. Partial failure should always be set to true.
#
# NOTE: This request contains a single conversion as a demonstration.
# However, if you have multiple conversions to upload, it's best to
# upload multiple conversions per request instead of sending a separate
# request per conversion. See the following for per-request limits:
# https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
my $response =
  $api_client->ConversionUploadService()->upload_click_conversions({
    customerId  => $customer_id,
    conversions => [$click_conversion],
    # Enable partial failure (must be true).
    partialFailure => "true"
  });
      

কার্ল

আপনার আমদানি পর্যালোচনা করুন

আপনার সাম্প্রতিক ইম্পোর্টগুলোর সার্বিক অবস্থা পর্যালোচনা করতে লিড ডায়াগনস্টিকস রিপোর্টের উন্নত রূপান্তরগুলো ব্যবহার করুন।

ইম্পোর্ট করা কনভার্সনগুলো রিপোর্টে মূল ক্লিকের ইম্প্রেশন তারিখ অনুযায়ী প্রতিফলিত হয়, ইম্পোর্ট অনুরোধের তারিখ বা ClickConversion এর conversion_date_time তারিখ অনুযায়ী নয়।

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

আপনার ক্যাম্পেইনের কনভার্সন মেট্রিক্সের উপর রিপোর্ট করার সময়, Google Ads UI মেট্রিক্সকে Google Ads API রিপোর্টিং ফিল্ডের সাথে সম্পর্কযুক্ত করতে 'Mapping user interface metrics' অংশটি দেখুন। এছাড়াও, আপনি একটি নির্দিষ্ট কনভার্সন অ্যাকশনের জন্য মোট কনভার্সনের সংখ্যা এবং মোট কনভার্সন ভ্যালু দেখতে conversion_action রিসোর্সটি কোয়েরি করতে পারেন।

সর্বোত্তম অনুশীলন

লিডের রূপান্তর বৃদ্ধি করার সময় নিম্নলিখিত সর্বোত্তম অনুশীলনগুলি মনে রাখবেন।

সম্পূর্ণতা নির্বিশেষে সমস্ত রূপান্তর ডেটা পাঠান।

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

যদি আপনি কোনো কনভার্সনের জন্য একটি order_id নির্ধারণ করেন, তবে আমরা সেটি অন্তর্ভুক্ত করার পরামর্শ দিই। যদি আপনার কাছে কোনো কনভার্সনের GCLID থাকে, তবে উন্নত পারফরম্যান্সের জন্য user_identifiers পাশাপাশি সেটিও পাঠানোর পরামর্শ দেওয়া হয়। এছাড়াও, যদি কনভার্সনটির জন্য আপনার একাধিক UserIdentifier থাকে, তবে ম্যাচ হওয়ার সম্ভাবনা বাড়াতে ClickConversion অবজেক্টে সবগুলোই অন্তর্ভুক্ত করুন।

একটি অনুরোধে একাধিক রূপান্তর একসাথে করুন

আপনার যদি একাধিক কনভার্সন ইম্পোর্ট করার থাকে, তবে প্রতিটি কনভার্সনের জন্য আলাদা ইম্পোর্ট রিকোয়েস্ট না পাঠিয়ে, সবগুলোকে একসাথে একটি UploadClickConversionsRequest এ যুক্ত করুন।

প্রতি অনুরোধে রূপান্তরের সংখ্যার সীমা জানতে কোটা নির্দেশিকা দেখুন।

যদি আপনি অফলাইন ডেটা ডায়াগনস্টিকসের মাধ্যমে একগুচ্ছ রিকোয়েস্টকে একই লজিক্যাল জবের অধীনে গ্রুপ করতে চান, তাহলে সমস্ত রিকোয়েস্টের job_id একই মানে সেট করুন। এটি তখন কাজে আসতে পারে যখন আপনার এমন একটিমাত্র জব বা প্রসেস থাকে যা একাধিক রিকোয়েস্ট ব্যবহার করে প্রচুর সংখ্যক কনভার্সন ইম্পোর্ট করে। যদি আপনি সেই প্রতিটি রিকোয়েস্টের job_id কে একই মানে সেট করেন, তাহলে আপনি job_summaries থেকে জবটির জন্য একটিমাত্র এন্ট্রি পেতে পারেন। এর পরিবর্তে, যদি আপনি Google Ads API-কে প্রতিটি রিকোয়েস্টের job_id তে একটি সিস্টেম-জেনারেটেড মান নির্ধারণ করতে দেন, তাহলে job_summaries এ প্রতিটি রিকোয়েস্টের জন্য একটি আলাদা এন্ট্রি থাকবে, যা আপনার জবের সামগ্রিক অবস্থা বিশ্লেষণ করাকে আরও কঠিন করে তুলতে পারে।

বাহ্যিক অ্যাট্রিবিউশন ডেটা ব্যবহার করবেন না।

লিডের জন্য এনহ্যান্সড কনভার্সন ব্যবহার করার সময়, ClickConversionexternal_attribution_data সেট করবেন না অথবা এমন কোনো conversion_action নির্দিষ্ট করবেন না যা এক্সটার্নাল অ্যাট্রিবিউশন মডেল ব্যবহার করে। Google Ads ব্যবহারকারীর দেওয়া ডেটা ব্যবহার করে করা ইম্পোর্টের জন্য এক্সটার্নালি অ্যাট্রিবিউটেড কনভার্সন সমর্থন করে না।

কাস্টম ভেরিয়েবল অন্তর্ভুক্ত করবেন না।

লিডের জন্য এনহ্যান্সড কনভার্সন ব্যবহার করার সময়, কোনো custom_variables অন্তর্ভুক্ত করবেন না। গুগল অ্যাডস কনভার্সন ইম্পোর্টে ব্যবহারকারীর দেওয়া ডেটার সাথে কাস্টম ভ্যারিয়েবলের ব্যবহার সমর্থন করে না। যদি ব্যবহারকারীর দেওয়া ডেটাযুক্ত কনভার্সনের সাথে কাস্টম ভ্যারিয়েবল অন্তর্ভুক্ত করা হয়, তবে সেই কনভার্সনগুলো অবৈধ বলে বিবেচিত হবে এবং বাতিল হয়ে যাবে।

সমস্যা সমাধান

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

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

সাধারণ ত্রুটিগুলি ডিবাগ করুন

ত্রুটি
NO_CONVERSION_ACTION_FOUND

নির্দিষ্ট রূপান্তর অ্যাকশনটি হয় সক্রিয় করা নেই, অথবা অনুরোধের `client_id` ফিল্ডে উল্লেখিত ক্লায়েন্ট অ্যাকাউন্ট দ্বারা এটি অ্যাক্সেস করা যাচ্ছে না। নিশ্চিত করুন যে আপনার আপলোডের রূপান্তর অ্যাকশনটি সক্রিয় আছে এবং আপলোড অনুরোধ প্রেরণকারী গ্রাহকের মালিকানাধীন।

অনুরোধে থাকা GCLID যদি এমন কোনো ক্লায়েন্ট অ্যাকাউন্টের হয়, যার অনুরোধে উল্লেখিত রূপান্তর ক্রিয়াটিতে অ্যাক্সেস নেই, তাহলেও এই ত্রুটিটি ঘটতে পারে। আপনি click_view রিসোর্স ব্যবহার করে একটি GCLID কোনো ক্লায়েন্ট অ্যাকাউন্টের কিনা তা যাচাই করতে পারেন। এর জন্য আপনাকে click_view.gclid এবং segments.date দ্বারা ফিল্টার করে একটি কোয়েরি জমা দিতে হবে, যেখানে date হলো ক্লিকটি সংঘটিত হওয়ার তারিখ।

INVALID_CONVERSION_ACTION_TYPE নির্দিষ্ট কনভার্সন অ্যাকশনটির টাইপটি লিডের এনহ্যান্সড কনভার্সনের জন্য বৈধ নয়। নিশ্চিত করুন যে আপনার আপলোড রিকোয়েস্টে নির্দিষ্ট করা ConversionAction টাইপ UPLOAD_CLICKS
CUSTOMER_NOT_ENABLED_ENHANCED_CONVERSIONS_FOR_LEADS আপনার কনভার্সন সেটিংসে লিডদের জন্য এনহ্যান্সড কনভার্সন চালু করা আছে কিনা, তা নিশ্চিত করুন। এর জন্য নির্দেশাবলী পূর্বশর্ত নির্দেশিকায় খুঁজুন।
DUPLICATE_ORDER_ID ইম্পোর্ট করা ইভেন্টগুলোতে একই অর্ডার আইডি সহ একাধিক কনভার্সন রয়েছে যা প্রসেস করা হয়নি। অর্ডার আইডিগুলো যেন অনন্য হয় তা নিশ্চিত করুন এবং আবার চেষ্টা করুন।
CLICK_NOT_FOUND প্রদত্ত ব্যবহারকারী শনাক্তকারীর সাথে মেলে এমন কোনো ক্লিক খুঁজে পাওয়া যায়নি। Google Ads API শুধুমাত্র তখনই এই ত্রুটিটি ফেরত দেয়, যখন UploadClickConversionsRequestdebug_enabled true থাকে।

যদি কোনো কনভার্সনে এই সতর্কতাটি দেখা দেয়, তাহলে গুগল অ্যাডস এপিআই এটিকে আপনার অফলাইন ডেটা ডায়াগনস্টিকসের successful_event_count এ অন্তর্ভুক্ত করে। গুগল অ্যাডস এপিআই alerts collection'-এ CLICK_NOT_FOUND এর জন্য একটি এন্ট্রি যোগ করে, যাতে আপনি এই সতর্কতার পুনরাবৃত্তি পর্যবেক্ষণ করতে পারেন।

ক্লিকটি যদি কোনো গুগল অ্যাডস ক্যাম্পেইন থেকে না আসে, তাহলে এই ত্রুটিটি হওয়া স্বাভাবিক। উদাহরণস্বরূপ, এটি SA360 বা DV360 থেকে আসতে পারে। অন্যান্য সম্ভাব্য কারণগুলো নিচে দেওয়া হলো:

বিরল কিছু ক্ষেত্রে, যখন আপলোডকারী গ্রাহক এবং গুগল অ্যাডস কনভার্সন গ্রাহক ভিন্ন হন, তখন এই ত্রুটির অর্থ হতে পারে যে আপলোডকারী গ্রাহক গ্রাহক ডেটার শর্তাবলী গ্রহণ করেছেন, কিন্তু পরিষেবা প্রদানকারী গ্রাহক তা করেননি।

কোনো অ্যাকাউন্ট গ্রাহক ডেটার শর্তাবলী গ্রহণ করেছে কিনা, তা আপনি customer রিসোর্স কোয়েরি করে এবং customer.offline_conversion_tracking_info.accepted_customer_data_terms ফিল্ডটি পরীক্ষা করে নির্ধারণ করতে পারেন।
,

আপনি গুগল অ্যাডস এপিআই (Google Ads API) ব্যবহার করে অফলাইন কনভার্সনগুলো গুগল অ্যাডস-এ ইম্পোর্ট করতে পারেন, যার মাধ্যমে অফলাইন জগতে (যেমন ফোনে বা কোনো সেলস প্রতিনিধির মাধ্যমে) বিক্রি হওয়া বিজ্ঞাপনগুলো ট্র্যাক করা যায়।

কনভার্সন ডেটা ইম্পোর্ট করার সুবিধাগুলোর পূর্ণ সদ্ব্যবহার করার জন্য, আমরা লিডগুলোর জন্য উন্নত কনভার্সন প্রয়োগ করার পরামর্শ দিই, যা স্থায়িত্ব ও কর্মক্ষমতা সর্বোচ্চ করতে GCLID এবং ব্যবহারকারীর দেওয়া ডেটা ব্যবহার করে।

উন্নত রূপান্তর

এনহ্যান্সড কনভার্সন আপনার কনভার্সনের সাথে ইমেল অ্যাড্রেস, ফোন নম্বর এবং মেইলিং অ্যাড্রেসের মতো ফার্স্ট-পার্টি কনভার্সন ডেটা যুক্ত করে আপনার কনভার্সন পরিমাপের নির্ভুলতা বাড়াতে সাহায্য করে।

উন্নত রূপান্তর দুই প্রকারের হয়। আরও বিস্তারিত জানতে, ‘উন্নত রূপান্তর সম্পর্কে’ দেখুন।

নিম্নলিখিত বিভাগে অফলাইন রূপান্তর কীভাবে উন্নত করা যায় তা ব্যাখ্যা করা হয়েছে, এই বৈশিষ্ট্যটি লিডের জন্য উন্নত রূপান্তর হিসাবেও পরিচিত।

লিডের জন্য বর্ধিত রূপান্তর বলতে কী বোঝায়?

লিডের জন্য উন্নত কনভার্সন হলো অফলাইন কনভার্সন ইম্পোর্টের একটি আপগ্রেড সংস্করণ, যা নির্ভুলতা এবং বিডিং পারফরম্যান্স উন্নত করার জন্য ইম্পোর্ট করা অফলাইন কনভার্সন ডেটার পরিপূরক হিসেবে ব্যবহারকারীর দেওয়া ডেটা, যেমন ইমেল অ্যাড্রেস, ব্যবহার করে। আপনি যখন আপনার অফলাইন কনভার্সন ইম্পোর্ট করেন, তখন প্রদত্ত হ্যাশ করা গ্রাহক ডেটা আপনার ওয়েবসাইটে সংগৃহীত একই ডেটার (যেমন একটি লিড ফর্ম) সাথে এবং আপনার বিজ্ঞাপনের সাথে যুক্ত হওয়া সাইন-ইন করা গ্রাহকদের সাথে মিলিয়ে গুগল অ্যাডস ক্যাম্পেইনের সাথে সংযুক্ত করতে ব্যবহৃত হয়। আরও তথ্যের জন্য, ‘লিডের জন্য উন্নত কনভার্সন সম্পর্কে’ দেখুন।

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

  • আপনি যদি একেবারে শুরু থেকে শুরু করেন, তাহলে পূর্বশর্ত অংশটি দিয়ে শুরু করুন।
  • আপনার যদি ইতিমধ্যেই অফলাইন কনভার্সন ইম্পোর্ট সেট আপ করা থাকে এবং আপনি লিডগুলির জন্য উন্নত কনভার্সনে আপগ্রেড করতে চান, তাহলে আমরা ট্যাগিং কনফিগার করুন (Configure tagging) বিভাগটি দিয়ে শুরু করার পরামর্শ দিই।
  • যদি আপনি ইতিমধ্যেই গুগল ট্যাগ সেট আপ করে থাকেন, অথবা গুগল ট্যাগ ব্যবহার করার পরিকল্পনা না থাকে এবং আপনার গুগল অ্যাডস এপিআই ইন্টিগ্রেশনের কাজ শুরু করতে চলেছেন, তাহলে সরাসরি এপিআই ইমপ্লিমেন্টেশন বিভাগে চলে যান।
  • যদি আপনি ব্যবহারকারী-প্রদত্ত ডেটা ইম্পোর্ট করতে না পারেন, অথবা আপনার রূপান্তরের জন্য বাহ্যিক অ্যাট্রিবিউশনের উপর নির্ভর করেন, তাহলে লিগ্যাসি অফলাইন কনভার্সন ইমপোর্টস গাইডটি দেখুন।

পূর্বশর্ত

প্রথমে, আমাদের 'শুরু করার নির্দেশিকা' বিভাগে দেওয়া ধাপগুলো আপনি সম্পন্ন করেছেন কিনা তা যাচাই করে নিন।

লিডের জন্য উন্নত রূপান্তর ব্যবহার করার আগে, আপনাকে অবশ্যই লিডের জন্য উন্নত রূপান্তরে অপ্ট-ইন করতে হবে এবং গ্রাহক ডেটার শর্তাবলী গ্রহণ করতে হবে। এই পূর্বশর্তগুলি ইতিমধ্যে পূরণ হয়েছে কিনা তা আপনি Google Ads রূপান্তর গ্রাহককে নিম্নলিখিত কোয়েরিটি পাঠিয়ে যাচাই করতে পারেন:

SELECT
  customer.id,
  customer.conversion_tracking_setting.accepted_customer_data_terms,
  customer.conversion_tracking_setting.enhanced_conversions_for_leads_enabled
FROM customer

যদি accepted_customer_data_terms অথবা enhanced_conversions_for_leads_enabled এর কোনো একটি false হয়, তাহলে এই পূর্বশর্তগুলো সম্পূর্ণ করতে Create a new conversion action- এর নির্দেশাবলী অনুসরণ করুন।

ট্যাগিং কনফিগার করুন

লিডদের জন্য উন্নত কনভার্সন চালু করতে, 'গুগল ট্যাগ সেটিংস কনফিগার করুন' এর নির্দেশাবলী অনুসরণ করে গুগল ট্যাগটি কনফিগার করুন। গুগল ট্যাগ ম্যানেজারের মাধ্যমে লিডদের জন্য উন্নত কনভার্সন সেট আপ করতে, এই নির্দেশাবলী অনুসরণ করুন।

এপিআই বাস্তবায়ন

গুগল অ্যাডস এপিআই ব্যবহার করে লিডগুলোর জন্য উন্নত কনভার্সন ইম্পোর্ট করার সামগ্রিক কার্যপ্রবাহ নিচে দেওয়া হলো।

  1. ব্যবহারকারীর দেওয়া ডেটা, যেমন ইমেল ঠিকানা, ফোন নম্বর এবং ডাক ঠিকানা, স্বাভাবিক করুন এবং হ্যাশ করুন

  2. ClickConversion অবজেক্টগুলি পূরণ করুন

    স্বাভাবিকীকৃত এবং হ্যাশ করা ব্যবহারকারী-প্রদত্ত ডেটা সহ

  3. ConversionUploadService ব্যবহার করে Google Ads API-তে ClickConversion অবজেক্টগুলো ইম্পোর্ট করুন । আরও বিস্তারিত জানতে UploadClickConversions দেখুন।

  4. আপনার আমদানিগুলো পর্যালোচনা করুন

আপনার রূপান্তর ক্রিয়া রিসোর্সের নাম পুনরুদ্ধার করুন

কনভার্সন আপলোড করতে, আপনাকে অবশ্যই Google Ads-এ ক্লিক কনভার্সন ইম্পোর্ট করার জন্য সেট আপ করা ConversionAction এর রিসোর্স নামটি উল্লেখ করতে হবে। আপনি নিম্নলিখিত GAQL কোয়েরি ব্যবহার করে conversion_action রিসোর্সটি কোয়েরি করার মাধ্যমে রিসোর্স নামটি খুঁজে পেতে পারেন:

SELECT
  customer.id,
  conversion_action.id,
  conversion_action.name,
  conversion_action.type,
  conversion_action.resource_name
FROM conversion_action
WHERE conversion_action.type = 'UPLOAD_CLICKS'
  AND conversion_action.status = 'ENABLED'

ব্যবহারকারীর দেওয়া ডেটা স্বাভাবিক করুন এবং হ্যাশ করুন

গোপনীয়তার স্বার্থে, নিম্নলিখিত ডেটা আমদানি করার আগে অবশ্যই SHA-256 ব্যবহার করে হ্যাশ করতে হবে:

  • ইমেইল ঠিকানা
  • ফোন নম্বর
  • প্রথম নাম
  • শেষ নাম
  • রাস্তার ঠিকানা

হ্যাশ ফলাফলগুলোকে মানসম্মত করার জন্য, এই মানগুলোর প্রত্যেকটিকে হ্যাশ করার আগে নিম্নলিখিত কাজগুলো করুন:

  • শুরুতে ও শেষে থাকা অতিরিক্ত স্পেস মুছে ফেলুন।
  • লেখাটিকে ছোট হাতের অক্ষরে রূপান্তর করুন।
  • E164 স্ট্যান্ডার্ড অনুযায়ী ফোন নম্বর ফরম্যাট করুন।

উন্নত রূপান্তরের জন্য ইমেল ঠিকানা বিন্যাস

উন্নত কনভার্সনের জন্য সর্বোচ্চ ম্যাচ রেট নিশ্চিত করতে, হ্যাশ করার আগে আপনাকে অবশ্যই ইমেল অ্যাড্রেসগুলো সঠিকভাবে ফরম্যাট করতে হবে। এই ধাপগুলো অনুসরণ করুন:

  1. স্ট্যান্ডার্ড নর্মালাইজেশন প্রয়োগ করুন (সকল ইমেল ঠিকানার জন্য):

    • শুরুতে বা শেষে থাকা যেকোনো অতিরিক্ত স্থান মুছে ফেলুন।
    • সম্পূর্ণ ইমেল ঠিকানাটিকে ছোট হাতের অক্ষরে রূপান্তর করুন।
  2. প্রযোজ্য ক্ষেত্রে, Gmail/Googlemail-এর জন্য নির্দিষ্ট স্বাভাবিকীকরণ প্রয়োগ করুন:

    • এই ধাপটি শুধুমাত্র gmail.com এবং googlemail.com ডোমেইনযুক্ত ইমেল ঠিকানাগুলোর ক্ষেত্রে প্রযোজ্য।
    • ডট ( . ) সরান: ইউজারনেমের অংশ থেকে ( @ এর আগে) সমস্ত ডট অক্ষর মুছে ফেলুন।
    • প্লাস চিহ্ন ( + ) বাদ দিন: ইউজারনেম অংশ থেকে প্লাস চিহ্ন ( + ) এবং এর পরের সমস্ত অক্ষর মুছে ফেলুন।

      • উদাহরণ: Jane.Doe+Shopping@googlemail.com প্রথমে jane.doe+shopping@googlemail.com (ছোট হাতের অক্ষরে) হয়, এবং তারপর janedoe@googlemail.com হয় (Gmail/Googlemail-এর নির্দিষ্ট নিয়ম অনুযায়ী)।
    • অন্যান্য ডোমেইন: gmail.com বা googlemail.com ছাড়া অন্য কোনো ডোমেইনের ইমেল ঠিকানার ইউজারনেম থেকে পিরিয়ড (.) বা প্লাস (.) সাফিক্স সরানো উচিত নয়। এই ঠিকানাগুলিতে শুধুমাত্র সাধারণ নর্মালাইজেশন (ছোট হাতের অক্ষর, অতিরিক্ত স্পেস বাদ দেওয়া) প্রয়োগ করুন।

      • উদাহরণ: user.name+NYC@Example.com স্বাভাবিক হয়ে user.name+nyc@example.com হবে।
  3. স্বাভাবিককৃত ইমেল ঠিকানাটি হ্যাশ করুন:

    • যথাযথ স্বাভাবিকীকরণ ধাপগুলো প্রয়োগ করার পর, প্রাপ্ত ইমেল ঠিকানাটিকে SHA-256 অ্যালগরিদম ব্যবহার করে হ্যাশ করুন।

নিম্নলিখিত ডেটা হ্যাশ করবেন না :

  • দেশ
  • রাজ্য
  • শহর
  • জিপ কোড

কোডের উদাহরণ

এই উদাহরণটি দেখায় কিভাবে ব্যবহারকারীর দেওয়া ডেটা নর্মালাইজ এবং হ্যাশ করতে হয়।

জাভা

private String normalizeAndHash(MessageDigest digest, String s)
    throws UnsupportedEncodingException {
  // Normalizes by first converting all characters to lowercase, then trimming spaces.
  String normalized = s.toLowerCase();
  // Removes leading, trailing, and intermediate spaces.
  normalized = normalized.replaceAll("\\s+", "");
  // Hashes the normalized string using the hashing algorithm.
  byte[] hash = digest.digest(normalized.getBytes("UTF-8"));
  StringBuilder result = new StringBuilder();
  for (byte b : hash) {
    result.append(String.format("%02x", b));
  }

  return result.toString();
}

/**
 * Returns the result of normalizing and hashing an email address. For this use case, Google Ads
 * requires removal of any '.' characters or trailing '+' and characters that follow it from the
 * username portion of the email address if the domain is {@code gmail.com} or {@code
 * googlemail.com}.
 *
 * @param digest the digest to use to hash the normalized string.
 * @param emailAddress the email address to normalize and hash.
 */
private String normalizeAndHashEmailAddress(MessageDigest digest, String emailAddress)
    throws UnsupportedEncodingException {
  // Removes all whitespace (leading, trailing, and intermediate) from the email address.
  String normalizedEmail = emailAddress.toLowerCase().replaceAll("\\s+", "");
  String[] emailParts = normalizedEmail.split("@", 2);
  if (emailParts.length == 2 && emailParts[1].matches("^(gmail|googlemail)\\.com$")) {
    // Removes any '.' characters from the portion of the email address before the domain if the
    // domain is gmail.com or googlemail.com.
    emailParts[0] = emailParts[0].replaceAll("\\.", "");
    // Removes any '+' and all characters that follow it from the portion of the email address
    // before the domain if the domain is gmail.com or googlemail.com.
    emailParts[0] = emailParts[0].replaceAll("\\+.*", "");
    normalizedEmail = String.format("%s@%s", emailParts[0], emailParts[1]);
  }
  return normalizeAndHash(digest, normalizedEmail);
}

/**
 * Returns the result of normalizing and hashing a phone number. For this use case, Google Ads
 * requires phone numbers to be in E.164 format.
 *
 * @param digest the digest to use to hash the normalized string.
 * @param phoneNumber the phone number to normalize and hash.
 */
private String normalizeAndHashPhoneNumber(MessageDigest digest, String phoneNumber)
    throws UnsupportedEncodingException {
  // Removes non-digit characters and prepends a leading '+' sign.
  String digitsOnly = phoneNumber.replaceAll("[^0-9]", "");
  String formattedPhone = "+" + digitsOnly;
  if (!formattedPhone.matches("^\\+[1-9]\\d{6,14}$")) {
    throw new IllegalArgumentException("Phone number must be in E.164 format: " + phoneNumber);
  }
  return normalizeAndHash(digest, formattedPhone);
}
      

সি#

/// <summary>
/// Normalizes the email address and hashes it. For this use case, Google Ads requires
/// removal of any '.' characters preceding <code>gmail.com</code> or
/// <code>googlemail.com</code>.
/// </summary>
/// <param name="emailAddress">The email address.</param>
/// <returns>The hash code.</returns>
private string NormalizeAndHashEmailAddress(string emailAddress)
{
    string normalizedEmail = emailAddress.ToLower();
    string[] emailParts = normalizedEmail.Split('@');
    if (emailParts.Length > 1 && (emailParts[1] == "gmail.com" ||
        emailParts[1] == "googlemail.com"))
    {
        // Removes any '.' characters from the portion of the email address before
        // the domain if the domain is gmail.com or googlemail.com.
        emailParts[0] = emailParts[0].Replace(".", "");
        normalizedEmail = $"{emailParts[0]}@{emailParts[1]}";
    }
    return NormalizeAndHash(normalizedEmail);
}

/// <summary>
/// Normalizes and hashes a string value.
/// </summary>
/// <param name="value">The value to normalize and hash.</param>
/// <returns>The normalized and hashed value.</returns>
private static string NormalizeAndHash(string value)
{
    return ToSha256String(digest, ToNormalizedValue(value));
}

/// <summary>
/// Hash a string value using SHA-256 hashing algorithm.
/// </summary>
/// <param name="digest">Provides the algorithm for SHA-256.</param>
/// <param name="value">The string value (e.g. an email address) to hash.</param>
/// <returns>The hashed value.</returns>
private static string ToSha256String(SHA256 digest, string value)
{
    byte[] digestBytes = digest.ComputeHash(Encoding.UTF8.GetBytes(value));
    // Convert the byte array into an unhyphenated hexadecimal string.
    return BitConverter.ToString(digestBytes).Replace("-", string.Empty);
}

/// <summary>
/// Removes leading and trailing whitespace and converts all characters to
/// lower case.
/// </summary>
/// <param name="value">The value to normalize.</param>
/// <returns>The normalized value.</returns>
private static string ToNormalizedValue(string value)
{
    return value.Trim().ToLower();
}
      

পিএইচপি

private static function normalizeAndHash(string $hashAlgorithm, string $value): string
{
    // Normalizes by first converting all characters to lowercase, then trimming spaces.
    $normalized = strtolower($value);
    // Removes leading, trailing, and intermediate spaces.
    $normalized = str_replace(' ', '', $normalized);
    return hash($hashAlgorithm, strtolower(trim($normalized)));
}

/**
 * Returns the result of normalizing and hashing an email address. For this use case, Google
 * Ads requires removal of any '.' characters preceding "gmail.com" or "googlemail.com".
 *
 * @param  string $hashAlgorithm the hash algorithm to use
 * @param  string $emailAddress  the email address to normalize and hash
 * @return string the normalized and hashed email address
 */
private static function normalizeAndHashEmailAddress(
    string $hashAlgorithm,
    string $emailAddress
): string {
    $normalizedEmail = strtolower($emailAddress);
    $emailParts = explode("@", $normalizedEmail);
    if (
        count($emailParts) > 1
        && preg_match('/^(gmail|googlemail)\.com\s*/', $emailParts[1])
    ) {
        // Removes any '.' characters from the portion of the email address before the domain
        // if the domain is gmail.com or googlemail.com.
        $emailParts[0] = str_replace(".", "", $emailParts[0]);
        $normalizedEmail = sprintf('%s@%s', $emailParts[0], $emailParts[1]);
    }
    return self::normalizeAndHash($hashAlgorithm, $normalizedEmail);
}
      

পাইথন

def normalize_and_hash_email_address(email_address: str) -> str:
    """Returns the result of normalizing and hashing an email address.

    For this use case, Google Ads requires removal of any '.' characters
    preceding "gmail.com" or "googlemail.com"

    Args:
        email_address: An email address to normalize.

    Returns:
        A normalized (lowercase, removed whitespace) and SHA-265 hashed string.
    """
    normalized_email: str = email_address.strip().lower()
    email_parts: list[str] = normalized_email.split("@")

    # Check that there are at least two segments
    if len(email_parts) > 1:
        # Removes any '.' and '+' characters from the portion of the email address
        # before the domain
        chars_to_remove = ".+"
        translation_table = str.maketrans("", "", chars_to_remove)
        email_parts[0] = email_parts[0].translate(translation_table)
        normalized_email = "@".join(email_parts)

    return normalize_and_hash(normalized_email)


def normalize_and_hash(s: str) -> str:
    """Normalizes and hashes a string with SHA-256.

    Private customer data must be hashed during upload, as described at:
    https://support.google.com/google-ads/answer/7474263

    Args:
        s: The string to perform this operation on.

    Returns:
        A normalized (lowercase, removed whitespace) and SHA-256 hashed string.
    """
    return hashlib.sha256(s.strip().lower().encode()).hexdigest()
      

রুবি

# Returns the result of normalizing and then hashing the string using the
# provided digest.  Private customer data must be hashed during upload, as
# described at https://support.google.com/google-ads/answer/7474263.
def normalize_and_hash(str)
  # Remove leading and trailing whitespace and ensure all letters are lowercase
  # before hashing.
  Digest::SHA256.hexdigest(str.strip.downcase)
end

# Returns the result of normalizing and hashing an email address. For this use
# case, Google Ads requires removal of any '.' characters preceding 'gmail.com'
# or 'googlemail.com'.
def normalize_and_hash_email(email)
  email_parts = email.downcase.split("@")
  # Removes any '.' characters from the portion of the email address before the
  # domain if the domain is gmail.com or googlemail.com.
  if email_parts.last =~ /^(gmail|googlemail)\.com\s*/
    email_parts[0] = email_parts[0].gsub('.', '')
  end
  normalize_and_hash(email_parts.join('@'))
end
      

পার্ল

sub normalize_and_hash {
  my $value = shift;

  # Removes leading, trailing, and intermediate spaces.
  $value =~ s/\s+//g;
  return sha256_hex(lc $value);
}

# Returns the result of normalizing and hashing an email address. For this use
# case, Google Ads requires removal of any '.' characters preceding 'gmail.com'
# or 'googlemail.com'.
sub normalize_and_hash_email_address {
  my $email_address = shift;

  my $normalized_email = lc $email_address;
  my @email_parts      = split('@', $normalized_email);
  if (scalar @email_parts > 1
    && $email_parts[1] =~ /^(gmail|googlemail)\.com\s*/)
  {
    # Remove any '.' characters from the portion of the email address before the
    # domain if the domain is 'gmail.com' or 'googlemail.com'.
    $email_parts[0] =~ s/\.//g;
    $normalized_email = sprintf '%s@%s', $email_parts[0], $email_parts[1];
  }
  return normalize_and_hash($normalized_email);
}
      

কার্ল

ClickConversion অবজেক্টগুলি পূরণ করুন

আপনার UploadClickConversionRequest এ থাকা ClickConversion অবজেক্টগুলোর সংগ্রহটি সেই কনভার্সনগুলোর সেটকে উপস্থাপন করে যা আপনি ইম্পোর্ট করতে চান। ClickConversion অবজেক্ট তৈরি করার সময় নিম্নলিখিত বিবরণগুলো মনে রাখবেন:

gclid

যখন কোনো ব্যক্তি আপনার বিজ্ঞাপনে ক্লিক করে আপনার ওয়েবসাইটে প্রবেশ করে, তখন ইউআরএল প্যারামিটার থেকে GCLID-গুলো সংগ্রহ করা হয়।

gbraid

gbraid হলো একটি URL প্যারামিটার, যা তখন উপস্থিত থাকে যখন কোনো ব্যবহারকারী ওয়েবে কোনো বিজ্ঞাপনে ক্লিক করে আপনার iOS অ্যাপে চলে যান।

wbraid

wbraid হলো একটি URL প্যারামিটার, যা তখন উপস্থিত থাকে যখন কোনো ব্যবহারকারী একটি iOS অ্যাপে কোনো বিজ্ঞাপনে ক্লিক করে আপনার ওয়েবপেজে চলে যান।

cart_data

একটি কনভার্সন সম্পর্কিত আইটেম-স্তরের বিবরণ এতে থাকে। গুগল অ্যাডস UI-তে বাস্কেট ডেটা—যেমন কেনা আইটেম, মূল্য এবং পরিমাণ—সম্পর্কে রিপোর্ট করার জন্য cart_data ফিল্ডটি পূরণ করা আবশ্যক। প্রয়োজনীয় কাঠামোর জন্য CartData অবজেক্টের সংজ্ঞা দেখুন এবং কার্ট ডেটা দিয়ে কনভার্সন সম্পর্কে আরও জানুন।

user_identifiers

লিডের জন্য এনহ্যান্সড কনভার্সন ব্যবহার করার সময়, আপনাকে অবশ্যই ইউজার-প্রদত্ত নর্মালাইজড এবং হ্যাশ করা ডেটা দিয়ে user_identifiers ফিল্ডটি পূরণ করতে হবে। যদি আপনার একাধিক ইউজার আইডেন্টিফায়ার থাকে, তবে প্রতিটির জন্য একটি করে আলাদা UserIdentifier তৈরি করুন, সর্বোচ্চ পাঁচটি আইডেন্টিফায়ার পর্যন্ত।

conversion_date_time

রূপান্তরের তারিখ ও সময়।

মানটিতে অবশ্যই একটি টাইমজোন উল্লেখ করা থাকতে হবে এবং এর ফরম্যাটটি yyyy-mm-dd HH:mm:ss+|-HH:mm হতে হবে, উদাহরণস্বরূপ: 2022-01-01 19:32:45-05:00 (ডেলাইট সেভিং টাইম উপেক্ষা করে)।

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

conversion_action

অফলাইন রূপান্তরের জন্য ConversionAction এর রিসোর্স নাম।

কনভার্সন অ্যাকশনটির type অবশ্যই UPLOAD_CLICKS হতে হবে এবং ক্লিকটির সাথে যুক্ত Google Ads অ্যাকাউন্টের Google Ads কনভার্সন কাস্টমারে এটি বিদ্যমান থাকতে হবে।

conversion_value

রূপান্তরের মান।

currency_code

conversion_value এর মুদ্রা কোড

consent

ClickConversion অবজেক্টের consent ফিল্ডটি পূরণ করার জন্য বিশেষভাবে সুপারিশ করা হচ্ছে। এটি সেট করা না থাকলে, আপনার কনভার্সনগুলো অ্যাট্রিবিউটেবল নাও হতে পারে।

order_id

এটি কনভার্সনের ট্রানজ্যাকশন আইডি হিসেবেও পরিচিত। এই ফিল্ডটি ঐচ্ছিক, কিন্তু এটি সেট করার জন্য জোরালোভাবে সুপারিশ করা হয়, কারণ অ্যাডজাস্টমেন্ট করার সময় এটি ইম্পোর্ট করা কনভার্সনগুলোকে রেফারেন্স করা সহজ করে তোলে। ইম্পোর্টের সময় যদি আপনি এটি সেট করেন, তবে যেকোনো অ্যাডজাস্টমেন্টের জন্য আপনাকে অবশ্যই এটি ব্যবহার করতে হবে। ডুপ্লিকেট কনভার্সন কমানোর জন্য কীভাবে ট্রানজ্যাকশন আইডি ব্যবহার করতে হয় সে সম্পর্কে আরও জানতে, এই হেল্প সেন্টার আর্টিকেলটি দেখুন।

custom_variables

কাস্টম রূপান্তর ভেরিয়েবলগুলোর মান।

Google Ads, wbraid বা gbraid সাথে কাস্টম কনভার্সন ভ্যারিয়েবল ব্যবহার সমর্থন করে না।

conversion_environment

যে পরিবেশে এই রূপান্তরটি রেকর্ড করা হয়েছিল তা নির্দেশ করে। উদাহরণস্বরূপ, APP বা WEB

session_attributes_encoded এবং session_attributes_key_value_pairs

সেশন অ্যাট্রিবিউট হলো সমষ্টিগত শনাক্তকারী যা কনভার্সন অ্যাট্রিবিউশনের জন্য ব্যবহৃত হয়। এগুলো GCLID, URL প্যারামিটার (যেমন GBRAID) এবং ব্যবহারকারীর দেওয়া ডেটার পাশাপাশি কাজ করে, যা লিডদের জন্য উন্নত কনভার্সনের কেন্দ্রবিন্দু। সেশন অ্যাট্রিবিউট ইম্পোর্ট করার দুটি উপায় আছে: ব্রাউজারে আমাদের জাভাস্ক্রিপ্ট কোড দ্বারা তৈরি এনকোডেড টোকেন প্রদান করে, অথবা প্রতিটি শনাক্তকারীর জন্য আলাদা কী-ভ্যালু পেয়ার প্রদান করে।

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

জাভা

// Sets one of the sessionAttributesEncoded or sessionAttributesKeyValuePairs if either is
// provided. The session attribute fields are only available to allowlisted users.
// To include these fields in conversion imports, upgrade to the Data Manager API.
if (rawRecord.containsKey("sessionAttributesEncoded")) {
  clickConversionBuilder.setSessionAttributesEncoded(
      ByteString.copyFromUtf8(rawRecord.get("sessionAttributesEncoded")));
} else if (rawRecord.containsKey("sessionAttributesMap")) {
  List<String> pairings =
      Arrays.stream(rawRecord.get("sessionAttributesMap").split(" "))
          .map(String::trim)
          .collect(Collectors.toList());
  SessionAttributesKeyValuePairs.Builder sessionAttributePairs =
      SessionAttributesKeyValuePairs.newBuilder();
  for (String pair : pairings) {
    String[] parts = pair.split("=", 2);
    if (parts.length != 2) {
      throw new IllegalArgumentException(
          "Failed to read the sessionAttributesMap. SessionAttributesMap must use a"
              + " space-delimited list of session attribute key value pairs. Each pair should"
              + " be separated by an equal sign, for example: 'gad_campaignid=12345"
              + " gad_source=1'");
    }
    sessionAttributePairs.addKeyValuePairs(
        SessionAttributeKeyValuePair.newBuilder()
            .setSessionAttributeKey(parts[0])
            .setSessionAttributeValue(parts[1])
            .build());
  }
  clickConversionBuilder.setSessionAttributesKeyValuePairs(sessionAttributePairs.build());
}
      

সি#

// The session attribute fields are only available to allowlisted users. To
// include these fields in conversion imports, upgrade to the Data Manager API.
if (!string.IsNullOrEmpty(sessionAttributesEncoded))
{
    clickConversion.SessionAttributesEncoded =
        ByteString.CopyFrom(sessionAttributesEncoded, Encoding.Unicode);
}
else if (!string.IsNullOrEmpty(sessionAttributes))
{
    IEnumerable<SessionAttributeKeyValuePair> parsedSessionAttributes =
        sessionAttributes.Split(';').Select(pair => {
            string[] split = pair.Split('=');
            return new SessionAttributeKeyValuePair()
            {
                SessionAttributeKey = split[0],
                SessionAttributeValue = split[1]
            };
        });

    clickConversion.SessionAttributesKeyValuePairs =
        new SessionAttributesKeyValuePairs();
    clickConversion.SessionAttributesKeyValuePairs.KeyValuePairs
        .AddRange(parsedSessionAttributes);
}
      

পিএইচপি

This example is not yet available in PHP; you can take a look at the other languages.
    

পাইথন

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded:
    click_conversion.session_attributes_encoded = session_attributes_encoded
elif session_attributes_dict:
    for key, value in session_attributes_dict.items():
        pair: SessionAttributeKeyValuePair = client.get_type(
            "SessionAttributeKeyValuePair"
        )
        pair.session_attribute_key = key
        pair.session_attribute_value = value
        click_conversion.session_attributes_key_value_pairs.key_value_pairs.append(
            pair
        )
      

রুবি

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded != nil
  cc.class.module_eval { attr_accessor :session_attributes_encoded}
  cc.session_attributes_encoded = session_attributes_encoded
elsif session_attributes_hash != nil
  # Add new attribute to click conversion object
  cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
  cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

  # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
  session_attributes_hash.each do |key, value|
    pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
    pair.session_attribute_key = key
    pair.session_attribute_value = value
    cc.session_attributes_key_value_pairs.key_value_pairs << pair
  end
end    
      

পার্ল

# Set one of the session_attributes_encoded or session_attributes_key_value_pairs
# fields if either are provided.
if (defined $session_attributes_encoded) {
  $click_conversion->{sessionAttributesEncoded} = $session_attributes_encoded;
} elsif (defined $session_attributes_hash) {
  while (my ($key, $value) = each %$session_attributes_hash) {
    my $pair =
      Google::Ads::GoogleAds::V25::Services::ConversionUploadService::SessionAttributeKeyValuePair
      ->new({sessionAttributeKey => $key, sessionAttributeValue => $value});
    push @{$click_conversion->{sessionAttributesKeyValuePairs}{keyValuePairs}
    }, $pair;
  }
}
      

কার্ল

user_ip_address

The IP address of the customer when they arrived on the landing page after an ad click and before a conversion event. This is the IP address of the customer's device, not the advertiser's server.

This field is a string representing an IP address in either IPv4 or IPv6 format. For example:

  • IPv4: "192.0.2.0"
  • IPv6: "2001:0DB8:1234:5678:9999:1111:0000:0001"

কোডের উদাহরণ

This example shows how to set your normalized and hashed user-provided data onto a ClickConversion object.

জাভা

// Creates an empty builder for constructing the click conversion.
ClickConversion.Builder clickConversionBuilder = ClickConversion.newBuilder();

// Extracts user email and phone from the raw data, normalizes and hashes it, then wraps it in
// UserIdentifier objects.
// Creates a separate UserIdentifier object for each. The data in this example is hardcoded, but
// in your application you might read the raw data from an input file.

// IMPORTANT: Since the identifier attribute of UserIdentifier
// (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier) is a
// oneof
// (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set only ONE of
// hashedEmail, hashedPhoneNumber, mobileId, thirdPartyUserId, or addressInfo. Setting more
// than one of these attributes on the same UserIdentifier will clear all the other members
// of the oneof. For example, the following code is INCORRECT and will result in a
// UserIdentifier with ONLY a hashedPhoneNumber.
//
// UserIdentifier incorrectlyPopulatedUserIdentifier =
//     UserIdentifier.newBuilder()
//         .setHashedEmail("...")
//         .setHashedPhoneNumber("...")
//         .build();

ImmutableMap.Builder<String, String> rawRecordBuilder =
    ImmutableMap.<String, String>builder()
        .put("email", "alex.2+myalias@gmail.com")
        // Phone number to be converted to E.164 format, with a leading '+' as required.
        .put("phone", "+1 (800) 555-0102")
        // This example lets you put conversion details as arguments, but in reality you might
        // store this data alongside other user data, so we include it in this sample user
        // record.
        .put("conversionActionId", Long.toString(conversionActionId))
        .put("conversionDateTime", conversionDateTime)
        .put("conversionValue", Double.toString(conversionValue))
        .put("currencyCode", "USD");

// Adds entries for the optional fields.
if (orderId != null) {
  rawRecordBuilder.put("orderId", orderId);
}
if (gclid != null) {
  rawRecordBuilder.put("gclid", gclid);
}
if (adUserDataConsent != null) {
  rawRecordBuilder.put("adUserDataConsent", adUserDataConsent.name());
}
if (sessionAttributesEncoded != null) {
  rawRecordBuilder.put("sessionAttributesEncoded", sessionAttributesEncoded);
}
if (sessionAttributesMap != null) {
  rawRecordBuilder.put("sessionAttributesMap", sessionAttributesMap);
}

// Builds the map representing the record.
Map<String, String> rawRecord = rawRecordBuilder.build();

// Creates a SHA256 message digest for hashing user identifiers in a privacy-safe way, as
// described at https://support.google.com/google-ads/answer/9888656.
MessageDigest sha256Digest = MessageDigest.getInstance("SHA-256");

// Creates a list for the user identifiers.
List<UserIdentifier> userIdentifiers = new ArrayList<>();

// Creates a user identifier using the hashed email address, using the normalize and hash method
// specifically for email addresses.
UserIdentifier emailIdentifier =
    UserIdentifier.newBuilder()
        // Optional: specify the user identifier source.
        .setUserIdentifierSource(UserIdentifierSource.FIRST_PARTY)
        // Uses the normalize and hash method specifically for email addresses.
        .setHashedEmail(normalizeAndHashEmailAddress(sha256Digest, rawRecord.get("email")))
        .build();
userIdentifiers.add(emailIdentifier);

// Creates a user identifier using normalized and hashed phone info.
UserIdentifier hashedPhoneNumberIdentifier =
    UserIdentifier.newBuilder()
        .setHashedPhoneNumber(normalizeAndHashPhoneNumber(sha256Digest, rawRecord.get("phone")))
        .build();
// Adds the hashed phone number identifier to the UserData object's list.
userIdentifiers.add(hashedPhoneNumberIdentifier);

// Adds the user identifiers to the conversion.
clickConversionBuilder.addAllUserIdentifiers(userIdentifiers);
      

C#

// Adds a user identifier using the hashed email address, using the normalize
// and hash method specifically for email addresses.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    HashedEmail = NormalizeAndHashEmailAddress("alex.2@example.com"),
    // Optional: Specifies the user identifier source.
    UserIdentifierSource = UserIdentifierSource.FirstParty
});

// Adds a user identifier using normalized and hashed phone info.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    HashedPhoneNumber = NormalizeAndHash("+1 800 5550102"),
    // Optional: Specifies the user identifier source.
    UserIdentifierSource = UserIdentifierSource.FirstParty
});

// Adds a user identifier with all the required mailing address elements.
clickConversion.UserIdentifiers.Add(new UserIdentifier()
{
    AddressInfo = new OfflineUserAddressInfo()
    {
        // FirstName and LastName must be normalized and hashed.
        HashedFirstName = NormalizeAndHash("Alex"),
        HashedLastName = NormalizeAndHash("Quinn"),
        // CountryCode and PostalCode are sent in plain text.
        CountryCode = "US",
        PostalCode = "94045"
    }
});
      

পিএইচপি

// Creates a click conversion with the specified attributes.
$clickConversion = new ClickConversion();

// Extract user email and phone from the raw data, normalize and hash it, then wrap it in
// UserIdentifier objects. Creates a separate UserIdentifier object for each.
// The data in this example is hardcoded, but in your application you might read the raw
// data from an input file.

// IMPORTANT: Since the identifier attribute of UserIdentifier
// (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier) is a
// oneof
// (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set only ONE
// of hashedEmail, hashedPhoneNumber, mobileId, thirdPartyUserId, or addressInfo. Setting
// more than one of these attributes on the same UserIdentifier will clear all the other
// members of the oneof. For example, the following code is INCORRECT and will result in a
// UserIdentifier with ONLY a hashedPhoneNumber.
//
// $incorrectlyPopulatedUserIdentifier = new UserIdentifier([
//    'hashed_email' => '...',
//    'hashed_phone_number' => '...'
// ]);

$rawRecord = [
    // Email address that includes a period (.) before the Gmail domain.
    'email' => 'alex.2@example.com',
    // Phone number to be converted to E.164 format, with a leading '+' as required.
    'phone' => '+1 800 5550102',
    // This example lets you input conversion details as arguments, but in reality you might
    // store this data alongside other user data, so we include it in this sample user
    // record.
    'orderId' => $orderId,
    'gclid' => $gclid,
    'conversionActionId' => $conversionActionId,
    'conversionDateTime' => $conversionDateTime,
    'conversionValue' => $conversionValue,
    'currencyCode' => 'USD',
    'adUserDataConsent' => $adUserDataConsent,
    'sessionAttributesEncoded' => $sessionAttributesEncoded,
    'sessionAttributesDict' => $sessionAttributesDict
];

// Creates a list for the user identifiers.
$userIdentifiers = [];

// Uses the SHA-256 hash algorithm for hashing user identifiers in a privacy-safe way, as
// described at https://support.google.com/google-ads/answer/9888656.
$hashAlgorithm = "sha256";

// Creates a user identifier using the hashed email address, using the normalize and hash
// method specifically for email addresses.
$emailIdentifier = new UserIdentifier(
    [
    // Uses the normalize and hash method specifically for email addresses.
    'hashed_email' => self::normalizeAndHashEmailAddress(
        $hashAlgorithm,
        $rawRecord['email']
    ),
    // Optional: Specifies the user identifier source.
    'user_identifier_source' => UserIdentifierSource::FIRST_PARTY
    ]
);
$userIdentifiers[] = $emailIdentifier;

// Checks if the record has a phone number, and if so, adds a UserIdentifier for it.
if (array_key_exists('phone', $rawRecord)) {
    $hashedPhoneNumberIdentifier = new UserIdentifier(
        [
        'hashed_phone_number' => self::normalizeAndHash(
            $hashAlgorithm,
            $rawRecord['phone'],
            true
        )
        ]
    );
    // Adds the hashed email identifier to the user identifiers list.
    $userIdentifiers[] = $hashedPhoneNumberIdentifier;
}

// Adds the user identifiers to the conversion.
$clickConversion->setUserIdentifiers($userIdentifiers);
      

পাইথন

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each. The data in this example is hardcoded, but in your
# application you might read the raw data from an input file.

# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must
# set only ONE of hashed_email, hashed_phone_number, mobile_id,
# third_party_user_id, or address_info. Setting more than one of these
# attributes on the same UserIdentifier will clear all the other members of
# the oneof. For example, the following code is INCORRECT and will result in
# a UserIdentifier with ONLY a hashed_phone_number:
#
# incorrectly_populated_user_identifier = client.get_type("UserIdentifier")
# incorrectly_populated_user_identifier.hashed_email = "...""
# incorrectly_populated_user_identifier.hashed_phone_number = "...""

raw_record: Dict[str, Union[str, float]] = {
    # Email address that includes a period (.) before the Gmail domain.
    "email": "alex.2@example.com",
    # Phone number to be converted to E.164 format, with a leading '+' as
    # required.
    "phone": "+1 800 5550102",
    # This example lets you input conversion details as arguments,
    # but in reality you might store this data alongside other user data,
    # so we include it in this sample user record.
    "order_id": order_id,
    "gclid": gclid,
    "conversion_action_id": conversion_action_id,
    "conversion_date_time": conversion_date_time,
    "conversion_value": conversion_value,
    "currency_code": "USD",
    "ad_user_data_consent": ad_user_data_consent,
}

# Constructs the click conversion.
click_conversion: ClickConversion = client.get_type("ClickConversion")
# Creates a user identifier using the hashed email address, using the
# normalize and hash method specifically for email addresses.
email_identifier: UserIdentifier = client.get_type("UserIdentifier")
# Optional: Specifies the user identifier source.
email_identifier.user_identifier_source = (
    client.enums.UserIdentifierSourceEnum.FIRST_PARTY
)
# Uses the normalize and hash method specifically for email addresses.
email_identifier.hashed_email = normalize_and_hash_email_address(
    raw_record["email"]
)
# Adds the user identifier to the conversion.
click_conversion.user_identifiers.append(email_identifier)

# Checks if the record has a phone number, and if so, adds a UserIdentifier
# for it.
if raw_record.get("phone") is not None:
    phone_identifier: UserIdentifier = client.get_type("UserIdentifier")
    phone_identifier.hashed_phone_number = normalize_and_hash(
        raw_record["phone"]
    )
    # Adds the phone identifier to the conversion adjustment.
    click_conversion.user_identifiers.append(phone_identifier)
      

রুবি

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each. The data in this example is hardcoded, but in your
# application you might read the raw data from an input file.

# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must
# set only ONE of hashed_email, hashed_phone_number, mobile_id,
# third_party_user_id, or address_info. Setting more than one of these
# attributes on the same UserIdentifier will clear all the other members of
# the oneof. For example, the following code is INCORRECT and will result in
# a UserIdentifier with ONLY a hashed_phone_number:
#
# incorrectly_populated_user_identifier.hashed_email = "...""
# incorrectly_populated_user_identifier.hashed_phone_number = "...""

raw_record = {
  # Email address that includes a period (.) before the Gmail domain.
  "email" => "alex.2@example.com",
  # Phone number to be converted to E.164 format, with a leading '+' as
  # required.
  "phone" => "+1 800 5550102",
  # This example lets you input conversion details as arguments,
  # but in reality you might store this data alongside other user data,
  # so we include it in this sample user record.
  "order_id" => order_id,
  "gclid" => gclid,
  "conversion_action_id" => conversion_action_id,
  "conversion_date_time" => conversion_date_time,
  "conversion_value" => conversion_value,
  "currency_code" => "USD",
  "ad_user_data_consent" => ad_user_data_consent,
  "session_attributes_encoded" => session_attributes_encoded,
  "session_attributes_hash" => session_attributes_hash
}

click_conversion = client.resource.click_conversion do |cc|
  cc.conversion_action = client.path.conversion_action(customer_id, conversion_action_id)
  cc.conversion_date_time = conversion_date_time
  cc.conversion_value = conversion_value.to_f
  cc.currency_code = 'USD'

  unless order_id.nil?
    cc.order_id = order_id
  end

  unless raw_record["gclid"].nil?
    cc.gclid = gclid
  end

  # Specifies whether user consent was obtained for the data you are
  # uploading. For more details, see:
  # https://www.google.com/about/company/user-consent-policy
  unless raw_record["ad_user_data_consent"].nil?
    cc.consent = client.resource.consent do |c|
      c.ad_user_data = ad_user_data_consent
    end
  end

  # Set one of the session_attributes_encoded or
  # session_attributes_key_value_pairs fields if either are provided.
  # The session attribute fields are only available to allowlisted users.
  # To include these fields in conversion imports, upgrade to the Data Manager API.
  if session_attributes_encoded != nil
    cc.class.module_eval { attr_accessor :session_attributes_encoded}
    cc.session_attributes_encoded = session_attributes_encoded
  elsif session_attributes_hash != nil
    # Add new attribute to click conversion object
    cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
    cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

    # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
    session_attributes_hash.each do |key, value|
      pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
      pair.session_attribute_key = key
      pair.session_attribute_value = value
      cc.session_attributes_key_value_pairs.key_value_pairs << pair
    end
  end    

  # Creates a user identifier using the hashed email address, using the
  # normalize and hash method specifically for email addresses.
  # If using a phone number, use the normalize_and_hash method instead.
  cc.user_identifiers << client.resource.user_identifier do |ui|
    ui.hashed_email = normalize_and_hash_email(raw_record["email"])
    # Optional: Specifies the user identifier source.
    ui.user_identifier_source = :FIRST_PARTY
  end

  # Checks if the record has a phone number, and if so, adds a UserIdentifier
  # for it.
  unless raw_record["phone"].nil?
    cc.user_identifiers << client.resource.user_identifier do |ui|
      ui.hashed_phone_number = normalize_and_hash(raw_record["phone"])
    end
  end
end
      

Perl

# Create an empty click conversion.
my $click_conversion =
  Google::Ads::GoogleAds::V25::Services::ConversionUploadService::ClickConversion
  ->new({});

# Extract user email and phone from the raw data, normalize and hash it,
# then wrap it in UserIdentifier objects. Create a separate UserIdentifier
# object for each.
# The data in this example is hardcoded, but in your application
# you might read the raw data from an input file.
#
# IMPORTANT: Since the identifier attribute of UserIdentifier
# (https://developers.google.com/google-ads/api/reference/rpc/latest/UserIdentifier)
# is a oneof
# (https://protobuf.dev/programming-guides/proto3/#oneof-features), you must set
# only ONE of hashed_email, hashed_phone_number, mobile_id, third_party_user_id,
# or address-info. Setting more than one of these attributes on the same UserIdentifier
# will clear all the other members of the oneof. For example, the following code is
# INCORRECT and will result in a UserIdentifier with ONLY a hashed_phone_number:
#
# my $incorrect_user_identifier = Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
#   hashedEmail => '...',
#   hashedPhoneNumber => '...',
# });
my $raw_record = {
  # Email address that includes a period (.) before the Gmail domain.
  email => 'alex.2@example.com',
  # Phone number to be converted to E.164 format, with a leading '+' as
  # required.
  phone => '+1 800 5550102',
  # This example lets you input conversion details as arguments,
  # but in reality you might store this data alongside other user data,
  # so we include it in this sample user record.
  orderId            => $order_id,
  gclid              => $gclid,
  conversionActionId => $conversion_action_id,
  conversionDateTime => $conversion_date_time,
  conversionValue    => $conversion_value,
  currencyCode       => "USD",
  adUserDataConsent  => $ad_user_data_consent
};
my $user_identifiers = [];

# Create a user identifier using the hashed email address, using the normalize
# and hash method specifically for email addresses.
my $hashed_email = normalize_and_hash_email_address($raw_record->{email});
push(
  @$user_identifiers,
  Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
      hashedEmail => $hashed_email,
      # Optional: Specify the user identifier source.
      userIdentifierSource => FIRST_PARTY
    }));

# Create a user identifier using normalized and hashed phone info.
my $hashed_phone = normalize_and_hash($raw_record->{phone});
push(
  @$user_identifiers,
  Google::Ads::GoogleAds::V25::Common::UserIdentifier->new({
      hashedPhone => $hashed_phone,
      # Optional: Specify the user identifier source.
      userIdentifierSource => FIRST_PARTY
    }));

# Add the user identifiers to the conversion.
$click_conversion->{userIdentifiers} = $user_identifiers;
      

কার্ল

This example shows how to set other necessary fields on a ClickConversion object.

জাভা

// Adds details of the conversion.
clickConversionBuilder.setConversionAction(
    ResourceNames.conversionAction(
        customerId, Long.parseLong(rawRecord.get("conversionActionId"))));
clickConversionBuilder.setConversionDateTime(rawRecord.get("conversionDateTime"));
clickConversionBuilder.setConversionValue(Double.parseDouble(rawRecord.get("conversionValue")));
clickConversionBuilder.setCurrencyCode(rawRecord.get("currencyCode"));

// Sets the order ID if provided.
if (rawRecord.containsKey("orderId")) {
  clickConversionBuilder.setOrderId(rawRecord.get("orderId"));
}

// Sets the Google click ID (gclid) if provided.
if (rawRecord.containsKey("gclid")) {
  clickConversionBuilder.setGclid(rawRecord.get("gclid"));
}

// Sets the consent information, if provided.
if (rawRecord.containsKey("adUserDataConsent")) {
  // Specifies whether user consent was obtained for the data you are uploading. See
  // https://www.google.com/about/company/user-consent-policy for details.
  clickConversionBuilder.setConsent(
      Consent.newBuilder()
          .setAdUserData(ConsentStatus.valueOf(rawRecord.get("adUserDataConsent"))));
}

// Sets one of the sessionAttributesEncoded or sessionAttributesKeyValuePairs if either is
// provided. The session attribute fields are only available to allowlisted users.
// To include these fields in conversion imports, upgrade to the Data Manager API.
if (rawRecord.containsKey("sessionAttributesEncoded")) {
  clickConversionBuilder.setSessionAttributesEncoded(
      ByteString.copyFromUtf8(rawRecord.get("sessionAttributesEncoded")));
} else if (rawRecord.containsKey("sessionAttributesMap")) {
  List<String> pairings =
      Arrays.stream(rawRecord.get("sessionAttributesMap").split(" "))
          .map(String::trim)
          .collect(Collectors.toList());
  SessionAttributesKeyValuePairs.Builder sessionAttributePairs =
      SessionAttributesKeyValuePairs.newBuilder();
  for (String pair : pairings) {
    String[] parts = pair.split("=", 2);
    if (parts.length != 2) {
      throw new IllegalArgumentException(
          "Failed to read the sessionAttributesMap. SessionAttributesMap must use a"
              + " space-delimited list of session attribute key value pairs. Each pair should"
              + " be separated by an equal sign, for example: 'gad_campaignid=12345"
              + " gad_source=1'");
    }
    sessionAttributePairs.addKeyValuePairs(
        SessionAttributeKeyValuePair.newBuilder()
            .setSessionAttributeKey(parts[0])
            .setSessionAttributeValue(parts[1])
            .build());
  }
  clickConversionBuilder.setSessionAttributesKeyValuePairs(sessionAttributePairs.build());
}

// Calls build to build the conversion.
ClickConversion clickConversion = clickConversionBuilder.build();
      

C#

// Adds details of the conversion.
clickConversion.ConversionAction =
    ResourceNames.ConversionAction(customerId, conversionActionId);
clickConversion.ConversionDateTime = conversionDateTime;
clickConversion.ConversionValue = conversionValue;
clickConversion.CurrencyCode = "USD";

// Sets the order ID if provided.
if (!string.IsNullOrEmpty(orderId))
{
    clickConversion.OrderId = orderId;
}

// Sets the Google click ID (gclid) if provided.
if (!string.IsNullOrEmpty(gclid))
{
    clickConversion.Gclid = gclid;
}

// The session attribute fields are only available to allowlisted users. To
// include these fields in conversion imports, upgrade to the Data Manager API.
if (!string.IsNullOrEmpty(sessionAttributesEncoded))
{
    clickConversion.SessionAttributesEncoded =
        ByteString.CopyFrom(sessionAttributesEncoded, Encoding.Unicode);
}
else if (!string.IsNullOrEmpty(sessionAttributes))
{
    IEnumerable<SessionAttributeKeyValuePair> parsedSessionAttributes =
        sessionAttributes.Split(';').Select(pair => {
            string[] split = pair.Split('=');
            return new SessionAttributeKeyValuePair()
            {
                SessionAttributeKey = split[0],
                SessionAttributeValue = split[1]
            };
        });

    clickConversion.SessionAttributesKeyValuePairs =
        new SessionAttributesKeyValuePairs();
    clickConversion.SessionAttributesKeyValuePairs.KeyValuePairs
        .AddRange(parsedSessionAttributes);
}

      

পিএইচপি

// Adds details of the conversion.
$clickConversion->setConversionAction(
    ResourceNames::forConversionAction($customerId, $rawRecord['conversionActionId'])
);
$clickConversion->setConversionDateTime($rawRecord['conversionDateTime']);
$clickConversion->setConversionValue($rawRecord['conversionValue']);
$clickConversion->setCurrencyCode($rawRecord['currencyCode']);

// Sets the order ID if provided.
if (!empty($rawRecord['orderId'])) {
    $clickConversion->setOrderId($rawRecord['orderId']);
}

// Sets the Google click ID (gclid) if provided.
if (!empty($rawRecord['gclid'])) {
    $clickConversion->setGclid($rawRecord['gclid']);
}

// Sets the ad user data consent if provided.
if (!empty($rawRecord['adUserDataConsent'])) {
    // Specifies whether user consent was obtained for the data you are uploading. See
    // https://www.google.com/about/company/user-consent-policy for details.
    $clickConversion->setConsent(
        new Consent(['ad_user_data' => $rawRecord['adUserDataConsent']])
    );
}

// Set one of the sessionAttributesEncoded or
// SessionAttributeKeyValuePair fields if either are provided. The session attribute
// fields are only available to allowlisted users. To include these fields in conversion
// imports, upgrade to the Data Manager API.
if (!empty($sessionAttributesEncoded)) {
    $clickConversion->setSessionAttributesEncoded($sessionAttributesEncoded);
} elseif (!empty($sessionAttributesDict)) {
    // Create a new container object to hold key-value pairs.
    $sessionAttributesKeyValuePairs = new SessionAttributesKeyValuePairs();
    // Initialize an array to hold individual key-value pair messages.
    $keyValuePairs = [];
    // Append each key-value pair provided to the $keyValuePairs array
    foreach ($sessionAttributesDict as $key => $value) {
        $pair = new SessionAttributeKeyValuePair();
        $pair->setSessionAttributeKey($key);
        $pair->setSessionAttributeValue($value);
        $keyValuePairs[] = $pair;
    }
    // Set the the full list of key-value pairs on the container object.
    $sessionAttributesKeyValuePairs->setKeyValuePairs($keyValuePairs);
    // Attach the container of key-value pairs to the ClickConversion object.
    $clickConversion->setSessionAttributesKeyValuePairs($sessionAttributesKeyValuePairs);
}
      

পাইথন

# Add details of the conversion.
# Gets the conversion action resource name.
conversion_action_service: ConversionActionServiceClient = (
    client.get_service("ConversionActionService")
)
click_conversion.conversion_action = (
    conversion_action_service.conversion_action_path(
        customer_id, raw_record["conversion_action_id"]
    )
)
click_conversion.conversion_date_time = raw_record["conversion_date_time"]
click_conversion.conversion_value = raw_record["conversion_value"]
click_conversion.currency_code = raw_record["currency_code"]

# Sets the order ID if provided.
if raw_record.get("order_id"):
    click_conversion.order_id = raw_record["order_id"]

# Sets the gclid if provided.
if raw_record.get("gclid"):
    click_conversion.gclid = raw_record["gclid"]

# Specifies whether user consent was obtained for the data you are
# uploading. For more details, see:
# https://www.google.com/about/company/user-consent-policy
if raw_record["ad_user_data_consent"]:
    click_conversion.consent.ad_user_data = client.enums.ConsentStatusEnum[
        raw_record["ad_user_data_consent"]
    ]

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded:
    click_conversion.session_attributes_encoded = session_attributes_encoded
elif session_attributes_dict:
    for key, value in session_attributes_dict.items():
        pair: SessionAttributeKeyValuePair = client.get_type(
            "SessionAttributeKeyValuePair"
        )
        pair.session_attribute_key = key
        pair.session_attribute_value = value
        click_conversion.session_attributes_key_value_pairs.key_value_pairs.append(
            pair
        )
      

রুবি

cc.conversion_action = client.path.conversion_action(customer_id, conversion_action_id)
cc.conversion_date_time = conversion_date_time
cc.conversion_value = conversion_value.to_f
cc.currency_code = 'USD'

unless order_id.nil?
  cc.order_id = order_id
end

unless raw_record["gclid"].nil?
  cc.gclid = gclid
end

# Specifies whether user consent was obtained for the data you are
# uploading. For more details, see:
# https://www.google.com/about/company/user-consent-policy
unless raw_record["ad_user_data_consent"].nil?
  cc.consent = client.resource.consent do |c|
    c.ad_user_data = ad_user_data_consent
  end
end

# Set one of the session_attributes_encoded or
# session_attributes_key_value_pairs fields if either are provided.
# The session attribute fields are only available to allowlisted users.
# To include these fields in conversion imports, upgrade to the Data Manager API.
if session_attributes_encoded != nil
  cc.class.module_eval { attr_accessor :session_attributes_encoded}
  cc.session_attributes_encoded = session_attributes_encoded
elsif session_attributes_hash != nil
  # Add new attribute to click conversion object
  cc.class.module_eval { attr_accessor :session_attributes_key_value_pairs}
  cc.session_attributes_key_value_pairs = ::Google::Ads::GoogleAds::V19::Services::SessionAttributesKeyValuePairs.new

  # Loop thru inputted session_attributes_hash to populate session_attributes_key_value_pairs
  session_attributes_hash.each do |key, value|
    pair = ::Google::Ads::GoogleAds::V19::Services::SessionAttributeKeyValuePair.new
    pair.session_attribute_key = key
    pair.session_attribute_value = value
    cc.session_attributes_key_value_pairs.key_value_pairs << pair
  end
end    
      

Perl

# Add details of the conversion.
$click_conversion->{conversionAction} =
  Google::Ads::GoogleAds::V25::Utils::ResourceNames::conversion_action(
  $customer_id, $raw_record->{conversionActionId});
$click_conversion->{conversionDateTime} = $raw_record->{conversionDateTime};
$click_conversion->{conversionValue}    = $raw_record->{conversionValue};
$click_conversion->{currencyCode}       = $raw_record->{currencyCode};

# Set the order ID if provided.
if (defined $raw_record->{orderId}) {
  $click_conversion->{orderId} = $raw_record->{orderId};
}

# Set the Google click ID (gclid) if provided.
if (defined $raw_record->{gclid}) {
  $click_conversion->{gclid} = $raw_record->{gclid};
}

# Set the consent information, if provided.
if (defined $raw_record->{adUserDataConsent}) {
  $click_conversion->{consent} =
    Google::Ads::GoogleAds::V25::Common::Consent->new({
      adUserData => $raw_record->{adUserDataConsent}});
}

# Set one of the session_attributes_encoded or session_attributes_key_value_pairs
# fields if either are provided.
if (defined $session_attributes_encoded) {
  $click_conversion->{sessionAttributesEncoded} = $session_attributes_encoded;
} elsif (defined $session_attributes_hash) {
  while (my ($key, $value) = each %$session_attributes_hash) {
    my $pair =
      Google::Ads::GoogleAds::V25::Services::ConversionUploadService::SessionAttributeKeyValuePair
      ->new({sessionAttributeKey => $key, sessionAttributeValue => $value});
    push @{$click_conversion->{sessionAttributesKeyValuePairs}{keyValuePairs}
    }, $pair;
  }
}
      

কার্ল

Construct the request

Once your ClickConversion objects are configured and added to the conversions field of the UploadClickConversionRequest object, set the following fields and pass the request to the UploadClickConversions method on the ConversionUploadService .

customer_id
Set this to the Google Ads conversion customer of the account that is the source of the clicks. If you're unsure which account is the correct one, refer to the customer.conversion_tracking_setting.google_ads_conversion_customer field in the example query in the getting started section.
job_id

Provides a mechanism for associating your import requests with the per-job information in offline data diagnostics .

If you don't set this field, the Google Ads API assigns each request a unique value in the range of [2^31, 2^63) . If you would prefer to group multiple requests into a single logical job, set this field to the same value in the range [0, 2^31) on every request in your job.

The job_id in the response contains the job ID for the request, regardless of whether you specified a value or let the Google Ads API assign a value.

partial_failure

This field must be set to true when importing conversions. Follow the partial failures guidelines when processing the response.

Import the request

Once you've populated your ClickConversion objects, and constructed your request, you can submit your import.

জাভা

// Creates the conversion upload service client.
try (ConversionUploadServiceClient conversionUploadServiceClient =
    googleAdsClient.getLatestVersion().createConversionUploadServiceClient()) {
  // Uploads the click conversion. Partial failure should always be set to true.

  // NOTE: This request contains a single conversion as a demonstration.  However, if you have
  // multiple conversions to upload, it's best to upload multiple conversions per request
  // instead of sending a separate request per conversion. See the following for per-request
  // limits:
  // https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
  UploadClickConversionsResponse response =
      conversionUploadServiceClient.uploadClickConversions(
          UploadClickConversionsRequest.newBuilder()
              .setCustomerId(Long.toString(customerId))
              .addConversions(clickConversion)
              // Enables partial failure (must be true).
              .setPartialFailure(true)
              .build());
      

C#

// Uploads the click conversion. Partial failure should always be set to true.
// NOTE: This request contains a single conversion as a demonstration.
// However, if you have multiple conversions to upload, it's best to upload multiple
// conversions per request instead of sending a separate request per conversion.
// See the following for per-request limits:
// https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload
UploadClickConversionsResponse response =
    conversionUploadService.UploadClickConversions(
        new UploadClickConversionsRequest()
        {
            CustomerId = customerId.ToString(),
            Conversions = { clickConversion },
            // Enables partial failure (must be true).
            PartialFailure = true
        });

      

পিএইচপি

// Issues a request to upload the click conversion.
$conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();
// NOTE: This request contains a single conversion as a demonstration.  However, if you have
// multiple conversions to upload, it's best to upload multiple conversions per request
// instead of sending a separate request per conversion. See the following for per-request
// limits:
// https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
$response = $conversionUploadServiceClient->uploadClickConversions(
    // Enables partial failure (must be true).
    UploadClickConversionsRequest::build($customerId, [$clickConversion], true)
);
      

পাইথন

# Creates the conversion upload service client.
conversion_upload_service: ConversionUploadServiceClient = (
    client.get_service("ConversionUploadService")
)
# Uploads the click conversion. Partial failure should always be set to
# True.
# NOTE: This request only uploads a single conversion, but if you have
# multiple conversions to upload, it's most efficient to upload them in a
# single request. See the following for per-request limits for reference:
# https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
response: UploadClickConversionsResponse = (
    conversion_upload_service.upload_click_conversions(
        customer_id=customer_id,
        conversions=[click_conversion],
        # Enables partial failure (must be true).
        partial_failure=True,
    )
)
      

রুবি

response = client.service.conversion_upload.upload_click_conversions(
  customer_id: customer_id,
  conversions: [click_conversion],
  # Partial failure must be true.
  partial_failure: true,
)

if response.partial_failure_error
  puts "Partial failure encountered: #{response.partial_failure_error.message}"
else
  result = response.results.first
  puts "Uploaded click conversion that happened at #{result.conversion_date_time} " \
    "to #{result.conversion_action}."
end
      

Perl

# Upload the click conversion. Partial failure should always be set to true.
#
# NOTE: This request contains a single conversion as a demonstration.
# However, if you have multiple conversions to upload, it's best to
# upload multiple conversions per request instead of sending a separate
# request per conversion. See the following for per-request limits:
# https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
my $response =
  $api_client->ConversionUploadService()->upload_click_conversions({
    customerId  => $customer_id,
    conversions => [$click_conversion],
    # Enable partial failure (must be true).
    partialFailure => "true"
  });
      

কার্ল

Review your imports

Use the enhanced conversions for leads diagnostics report to review the overall health of your recent imports.

Imported conversions are reflected in reports for the impression date of the original click , not the date of the import request or the date of the conversion_date_time of the ClickConversion .

It takes up to three hours for imported conversion statistics to appear in your Google Ads account for last-click attribution. For other search attribution models, it can take longer than three hours. Consult the data freshness guide for more information.

When reporting on conversion metrics for your campaigns, refer to Mapping user interface metrics to correlate Google Ads UI metrics with Google Ads API reporting fields. You can also query the conversion_action resource to view the total number of conversions and the total conversion value for a given conversion action.

সর্বোত্তম অনুশীলন

Keep the following best practices in mind when implementing enhanced conversions for leads.

Send all conversion data regardless of completeness

To ensure full and accurate conversion reporting, import all available offline conversion events, including those that might not have come from Google Ads. Conversions that include only user-provided data are still useful and can contribute positively to Google Ads campaign optimization.

If you assign an order_id to a conversion, we recommend including it. If you have the GCLID for a conversion, we recommend sending it in addition to the user_identifiers for improved performance. Furthermore, if you have more than one UserIdentifier for the conversion, include all of them on the ClickConversion object to improve the likelihood of a match.

Batch multiple conversions in a single request

If you have multiple conversions to import, batch the conversions into one UploadClickConversionsRequest , rather than sending an import request per conversion.

Check the quota guide for limits on the number of conversions per request.

If you want offline data diagnostics to group a set of requests under the same logical job, set the job_id of all the requests to the same value. This can be useful if you have a single job or process that imports a large number of conversions using multiple requests. If you set the job_id on each of those requests to the same value, then you can retrieve a single entry for the job from job_summaries . If instead you let the Google Ads API assign a system-generated value to the job_id of each request, the job_summaries contains a separate entry for each request, which could make analyzing the overall health of your job more challenging.

Don't use external attribution data

When using enhanced conversions for leads, don't set external_attribution_data on the ClickConversion or specify a conversion_action that uses an external attribution model. Google Ads doesn't support externally attributed conversions for imports using user-provided data.

Don't include custom variables

When using enhanced conversions for leads, don't include any custom_variables . Google Ads doesn't support the use of custom variables with user-provided data in conversion imports. If custom variables are included with conversions that contain user-provided data, those conversions will be considered invalid and dropped.

সমস্যা সমাধান

Offline data diagnostics provide a single resource for reviewing the overall health of your imports on an ongoing basis. However, during implementation you can use the information in this section to investigate any errors reported in the partial_failure_error field of the response.

Some of the most common errors when importing conversion actions are authorization errors, such as USER_PERMISSION_DENIED . Double check that you have the customer ID in your request set to the Google Ads conversion customer which owns the conversion action. Visit our authorization guide for more details and see our common errors guide for tips on how to debug these different errors.

Debug common errors

ত্রুটি
NO_CONVERSION_ACTION_FOUND

The specified conversion action is either not enabled, or cannot be accessed by the client account specified by the `client_id` field in the request. Make sure the conversion action in your upload is enabled and is owned by the customer sending the upload request.

This error may also occur if the GCLID in the request belongs to a client account that does not have access to the conversion action specified in the request. You can verify whether a GCLID belongs to a client account using the click_view resource, by submitting a query that filters by click_view.gclid and segments.date , where the date is the date the click occurred.

INVALID_CONVERSION_ACTION_TYPE The specified conversion action has a type that is not valid for enhanced conversions for leads. Make sure the ConversionAction specified in your upload request has type UPLOAD_CLICKS .
CUSTOMER_NOT_ENABLED_ENHANCED_CONVERSIONS_FOR_LEADS Make sure you've enabled enhanced conversions for leads in your conversion settings. Find instructions for this in the prerequisites guide.
DUPLICATE_ORDER_ID Imported events include multiple conversions with the same Order ID and were not processed. Make sure Order IDs are unique and try again.
CLICK_NOT_FOUND No click was found that matched the provided user identifiers. The Google Ads API only returns this error if debug_enabled is true on the UploadClickConversionsRequest .

If a conversion encounters this warning, the Google Ads API includes it in the successful_event_count of your offline data diagnostics . The Google Ads API includes an entry for CLICK_NOT_FOUND in the alerts collection so you can monitor the frequency of this warning.

This error is expected if the click is not from a Google Ads campaign. For example it may come from SA360 or DV360 . Other possible causes are as follows:

In rare instances where the uploading customer is different from the Google Ads conversion customer, this error can mean that the uploading customer has accepted the customer data terms, but the serving customer has not.

You can determine if an account has accepted the customer data terms by querying the customer resource and checking the customer.offline_conversion_tracking_info.accepted_customer_data_terms field.