CM360 ऑफ़लाइन कन्वर्ज़न एपीआई, वेबसाइट टैग-आधारित को बेहतर बनाने में मदद करता है उपयोगकर्ता आइडेंटिफ़ायर की मदद से कन्वर्ज़न मेज़र करना.
सुझाया गया सेटअप
- बेहतर कन्वर्ज़न ट्रैकिंग की शर्तें स्वीकार करें आपके Floodlight के लिए सेवा CM360 की मदद से कॉन्फ़िगर किया गया है.
- मैच आईडी का इस्तेमाल करके, अपनी वेबसाइटों को इंस्ट्रुमेंट करें.
- अपनी वेबसाइट पर होने वाले Floodlight कन्वर्ज़न रिकॉर्ड करें. रिकॉर्ड करना न भूलें
इन सभी एट्रिब्यूट को सबमिट करना ज़रूरी है, क्योंकि बाद में होने वाले एपीआई कॉल में ये ज़रूरी फ़ील्ड होते हैं:
matchId
ordinal
timestampMicros
floodlightActivityId
floodlightConfigurationId
quantity
value
- ऑनलाइन टैग ने कन्वर्ज़न कैप्चर किया, 90 मिनट बीत जाने के बाद,
इन्हें बेहतर बनाने के लिए,
conversions.batchupdate
को कॉल करें उपयोगकर्ता आइडेंटिफ़ायर की मदद से कन्वर्ज़न मेज़र करना.- उपयोगकर्ता आइडेंटिफ़ायर फ़ॉर्मैट और हैश किए गए होने चाहिए. साथ ही,
कन्वर्ज़न ऑब्जेक्ट का
userIdentifiers
फ़ील्ड. - मात्रा और वैल्यू के बारे में बताना ज़रूरी है.
कन्वर्ज़न की संख्या और वैल्यू में, ज़रूरत के हिसाब से बदलाव किया जा सकता है. इसके लिए,
वही
conversions.batchupdate
कॉल करें या ओरिजनल संख्या दें और वैल्यू. - इंसर्ट और अपडेट के हर बैच में, अलग-अलग तरह की सफलताएं और
कोई गड़बड़ी हुई. अगर ज़्यादा समय लगता है, तो
NOT_FOUND
टेस्ट को फिर से करने की कोशिश की जानी चाहिए कन्वर्ज़न प्रोसेस होने में आम तौर पर छह घंटे तक की देरी होती है. - इसके बाद, 24 घंटे के अंदर कन्वर्ज़न को उपयोगकर्ता आइडेंटिफ़ायर की मदद से बेहतर बनाना ज़रूरी है उन्हें ऑनलाइन टैग से कैप्चर कर लिया जाता है.
- उपयोगकर्ता आइडेंटिफ़ायर फ़ॉर्मैट और हैश किए गए होने चाहिए. साथ ही,
कन्वर्ज़न ऑब्जेक्ट का
नॉर्मलाइज़ेशन और हैशिंग
ईमेल पते, फ़ोन नंबर, नाम, और सरनेम की निजता को सुरक्षित रखने के लिए और मोहल्ले के पते पहले SHA-256 एल्गोरिदम का इस्तेमाल करके हैश किए जाने चाहिए अपलोड किया जा रहा है. हैश करने से पहले, हैश के नतीजों का स्टैंडर्ड तय करने के लिए तो आपको ये काम करने होंगे:
- शुरू या पीछे की खाली सफ़ेद जगहों को हटाएं.
- टेक्स्ट को अंग्रेज़ी के छोटे अक्षरों में बदलें.
- फ़ोन नंबरों को E164 स्टैंडर्ड वाले फ़ॉर्मैट के हिसाब से रखें.
gmail.com
में डोमेन नेम से पहले के सभी पीरियड (.) हटाएं औरgooglemail.com
ईमेल पते.
C#
/// <summary>
/// Normalizes the email address and hashes it. For this use case, Campaign Manager 360
/// 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();
}
Java
private String normalizeAndHash(MessageDigest digest, String s)
throws UnsupportedEncodingException {
// Normalizes by removing leading and trailing whitespace and converting all characters to
// lower case.
String normalized = s.trim().toLowerCase();
// 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, Campaign Manager 360
* requires removal of any '.' characters preceding {@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 {
String normalizedEmail = emailAddress.toLowerCase();
String[] emailParts = normalizedEmail.split("@");
if (emailParts.length > 1 && emailParts[1].matches("^(gmail|googlemail)\\.com\\s*")) {
// 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("\\.", "");
normalizedEmail = String.format("%s@%s", emailParts[0], emailParts[1]);
}
return normalizeAndHash(digest, normalizedEmail);
}
PHP
private static function normalizeAndHash(string $hashAlgorithm, string $value): string
{
return hash($hashAlgorithm, strtolower(trim($value)));
}
/**
* Returns the result of normalizing and hashing an email address. For this use case, Campaign
* Manager 360 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);
}
Python
def normalize_and_hash_email_address(email_address):
"""Returns the result of normalizing and hashing an email address.
For this use case, Campaign Manager 360 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 = email_address.lower()
email_parts = normalized_email.split("@")
# Checks whether the domain of the email address is either "gmail.com"
# or "googlemail.com". If this regex does not match then this statement
# will evaluate to None.
is_gmail = re.match(r"^(gmail|googlemail)\.com$", email_parts[1])
# Check that there are at least two segments and the second segment
# matches the above regex expression validating the email domain name.
if len(email_parts) > 1 and is_gmail:
# Removes any '.' characters from the portion of the email address
# before the domain if the domain is gmail.com or googlemail.com.
email_parts[0] = email_parts[0].replace(".", "")
normalized_email = "@".join(email_parts)
return normalize_and_hash(normalized_email)
def normalize_and_hash(s):
"""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()
Ruby
# 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 hasing.
Digest::SHA256.hexdigest(str.strip.downcase)
end
# Returns the result of normalizing and hashing an email address. For this use
# case, Campaign Manager 360 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
कन्वर्ज़न में उपयोगकर्ता आइडेंटिफ़ायर जोड़ना
अपलोड करने के लिए, पहले Conversion
ऑब्जेक्ट को तैयार करें या
सामान्य तरीके से बदलाव करना. इसके बाद, यूज़र आइडेंटिफ़ायर को इस तरह अटैच करें:
{
"matchId": "my-match-id-846513278",
"ordinal": "my-ordinal-12345678512",
"quantity": 1,
"value": 104.23,
"timestampMicros": 1656950400000000,
"floodlightConfigurationId": 99999,
"floodlightActivityId": 8888,
"userIdentifiers": [
{ "hashedEmail": "0c7e6a405862e402eb76a70f8a26fc732d07c32931e9fae9ab1582911d2e8a3b" },
{ "hashedPhoneNumber": "1fb1f420856780a29719b994c8764b81770d79f97e2e1861ba938a7a5a15dfb9" },
{
"addressInfo": {
"hashedFirstName": "81f8f6dde88365f3928796ec7aa53f72820b06db8664f5fe76a7eb13e24546a2",
"hashedLastName": "799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f",
"hashedStreetAddress": "22b7e2d69b91e0ef4a88e81a73d897b92fd9c93ccfbe0a860f77db16c26f662e",
"city": "seattle",
"state": "washington",
"countryCode": "US",
"postalCode": "98101"
}
}
]
}
सही जवाब कुछ ऐसा दिखना चाहिए:
{
"hasFailures": false,
"status": [
{
"conversion": {
"floodlightConfigurationId": 99999,
"floodlightActivityId": 8888,
"timestampMicros": 1656950400000000,
"value": 104.23,
"quantity": 1,
"ordinal": "my-ordinal-12345678512",
"matchId": "my-match-id-846513278",
"userIdentifiers": [
{ "hashedEmail": "0c7e6a405862e402eb76a70f8a26fc732d07c32931e9fae9ab1582911d2e8a3b" },
{ "hashedPhoneNumber": "1fb1f420856780a29719b994c8764b81770d79f97e2e1861ba938a7a5a15dfb9" },
{
"addressInfo": {
"hashedFirstName": "81f8f6dde88365f3928796ec7aa53f72820b06db8664f5fe76a7eb13e24546a2",
"hashedLastName": "799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f",
"hashedStreetAddress": "22b7e2d69b91e0ef4a88e81a73d897b92fd9c93ccfbe0a860f77db16c26f662e",
"city": "seattle",
"state": "washington",
"countryCode": "US",
"postalCode": "98101"
}
}
],
"kind": "dfareporting#conversion"
},
"kind": "dfareporting#conversionStatus"
}
]
}
आम तौर पर होने वाली गड़बड़ियां
उपयोगकर्ता के साथ कन्वर्ज़न को बेहतर बनाते समय, आपको ये गड़बड़ियां दिख सकती हैं आइडेंटिफ़ायर:
- हैश किया गया_X फ़ील्ड मान्य SHA-256 हैश नहीं है
- हैश किए गए सभी फ़ील्ड से पहले, कोड में बदले गए SHA-256 हैश ही स्वीकार किए जाते हैं हेक्साडेसिमल.
- फ़ील्ड country_code की लंबाई गलत है
country_code
में सिर्फ़ दो अक्षर होने चाहिए.- Floodlight कॉन्फ़िगरेशन ने बेहतर कन्वर्ज़न ट्रैकिंग की सेवा की शर्तों पर हस्ताक्षर नहीं किया है
- बेहतर कन्वर्ज़न ट्रैकिंग की सेवा की शर्तें स्वीकार नहीं की गई हैं अनुरोध का Floodlight कॉन्फ़िगरेशन आईडी.
- पांच से ज़्यादा user_identifiers दिए गए हैं
- एक कन्वर्ज़न में ज़्यादा से ज़्यादा पांच उपयोगकर्ता आइडेंटिफ़ायर हो सकते हैं.
अक्सर पूछे जाने वाले सवाल
- मैच आईडी का सुझाव क्यों दिया जाता है?
- क्लिक आईडी के आधार पर किए गए बदलावों में वे कन्वर्ज़न शामिल नहीं होते हैं जिन पर क्लिक और सीमाएं नहीं होती हैं वैल्यू को बेहतर कन्वर्ज़न ट्रैकिंग के साथ इंटिग्रेट करने का तरीक़ा बताया गया है.
- संख्या और वैल्यू क्यों रिकॉर्ड की जानी चाहिए?
- CM360 ऑफ़लाइन कन्वर्ज़न एपीआई के लिए, प्रॉडक्ट की संख्या और वैल्यू इतनी होनी चाहिए बताया गया है.
- क्या मुझे किसी ऑनलाइन टैग पर आधारित कन्वर्ज़न में बदलाव करने के लिए, Google से रिकॉर्ड किया गया सटीक माइक्रोसेकंड टाइमस्टैंप हासिल करना होगा?
- मैच आईडी के आधार पर किए गए बदलावों के लिए, एपीआई अब बदलाव को तब तक स्वीकार करता है, जब तक अनुरोध में दिया गया टाइमस्टैंप, Google रिकॉर्ड किए जाने के एक मिनट के अंदर का है टाइमस्टैंप के बारे में ज़्यादा जानें.
- कन्वर्ज़न को बेहतर बनाने के लिए, ऑनलाइन टैग से कैप्चर किए जाने के बाद मुझे 90 मिनट तक इंतज़ार क्यों करना चाहिए?
- ऑनलाइन कन्वर्ज़न को इंडेक्स होने में 90 मिनट लग सकते हैं. एपीआई और बदलावों के लिए उपलब्ध रहें.
- एपीआई से मिले रिस्पॉन्स में मुझे किन बातों पर ध्यान देना चाहिए?
- भले ही, CM360 Conversion API से आपको सही रिस्पॉन्स मिलता है. हालांकि, कुछ मामलों में
हो सकता है कि अलग-अलग कन्वर्ज़न अपलोड या अपडेट न हो पाए हों. टूल की जांच करें
गड़बड़ियों के लिए अलग-अलग
ConversionStatus
फ़ील्ड:- अगर आपको
NOT_FOUND
अपडेट नहीं चाहिए, तो ज़्यादा से ज़्यादा छह घंटे में दोबारा कोशिश की जा सकती है कन्वर्ज़न प्रोसेस होने में सामान्य से ज़्यादा समय लग रहा है. यह भी देखेंNOT_FOUND
गड़बड़ियां, छह से ज़्यादा क्यों हो सकती हैं, इस बारे में अक्सर पूछे जाने वाले सवाल घंटे. INVALID_ARGUMENT
औरPERMISSION_DENIED
गड़बड़ियों की फिर से कोशिश नहीं करनी चाहिए.
- अगर आपको