Müşteri Eşleştirme kitlelerini yükleme

Yüklenen müşteri iletişim bilgilerini veya Display & Video 360 API'sini kullanarak mobil cihaz kimliklerini kullanarak Müşteri Eşleştirme kitleleri oluşturabilirsiniz. Bu sayfada, ilk Müşteri Eşleştirme kitlesinin nasıl oluşturulacağı ve Display & Video 360 API kullanılarak mevcut kitleye yeni müşteri verilerinin nasıl ekleneceği açıklanmaktadır.

Kullanıcı verilerini hazırlama

Müşteri Eşleştirme kitlelerini doldurmak için kullanılan kullanıcı verileri hassastır ve yüklenmeden önce uygun şekilde hazırlanmalıdır.

Hassas verileri karma haline getirme

Bazı Müşteri Eşleştirme kitleleri, hassas müşteri iletişim bilgileri kullanılarak oluşturulur. Display & Video 360, yüklenmeden önce hassas verilere SHA256 algoritması kullanılarak karma oluşturma işlemi uygulanmasını gerektirir. Yüklemeden önce aşağıdaki veri alanlarına karma oluşturma işlemi uygulanmalıdır:

  • Ad
  • Soyadı
  • E-posta adresleri
  • Telefon numaraları

Posta kodlarına ve ülke kodlarına, yüklemeden önce karma oluşturma işlemi uygulanmamalıdır. Karma oluşturma işlemi uygulanmamış müşteri verileri yüklenmeye çalışıldığında hatayla sonuçlanır.

Verilere karma oluşturma işlemi uygulamadan önce aşağıdaki koşulların sağlandığından emin olun:

  • Ad, soyadı ve e-posta adresi değerlerindeki tüm boşluklar kaldırılmalıdır.
  • Tüm değerler küçük harfle yazılmalıdır.
  • Tüm telefon numaraları E.164 biçimi kullanılarak biçimlendirilmeli ve ülke arama kodu içermelidir.

Kullanıcı verilerini yüklerken, dahil edilen kullanıcılar tarafından verilen izin sinyallerini iletmek için sağlanan ContactInfoList veya MobileDeviceIdList nesnelerindeki consent alanlarını kullanın.

Consent nesnesindeki alanlardan herhangi birinin CONSENT_STATUS_DENIED olarak ayarlanması hatayla sonuçlanır.

İzin sinyalleri, tek bir firstAndThirdPartyAudiences.create veya firstAndThirdPartyAudiences.editCustomerMatchMembers isteğine eklenen tüm kullanıcılar için ayarlanır. Farklı izin sinyallerine sahip kullanıcılar ayrı isteklerde yüklenmelidir.

Müşteri Eşleştirme kitlesi oluşturma

firstAndThirdPartyAudiences.create yöntemi kullanılarak Müşteri Eşleştirme kitlesi oluşturulabilir. Kitlenin birinci taraf kitle olarak belirtilmesi ve CUSTOMER_MATCH_CONTACT_INFO veya CUSTOMER_MATCH_DEVICE_ID audienceType değerine sahip olması gerekir. Müşteri Eşleştirme verileri, birleştirme alanındaki members uygun alan kullanılarak sağlanmalıdır.

Aşağıda, karma oluşturma işlemi uygulanmış telefon numaralarından oluşan bir liste kullanılarak sınırsız üyelik süresine sahip yeni bir iletişim bilgileri Müşteri Eşleştirme kitlesi oluşturma örneği verilmiştir:

Java

// Create Customer Match audience object.
FirstAndThirdPartyAudience customerMatchAudience =
    new FirstAndThirdPartyAudience()
        .setDisplayName(display-name)
        .setFirstAndThirdPartyAudienceType(
            "FIRST_AND_THIRD_PARTY_AUDIENCE_TYPE_FIRST_PARTY"
        )
        .setAudienceType("CUSTOMER_MATCH_CONTACT_INFO")
        .setMembershipDurationDays(10000L);

// Build list of contact information objects.
ContactInfoList contactInfoList = new ContactInfoList();
ArrayList<ContactInfo> contactInfos = new ArrayList<ContactInfo>();
for (String hashedPhoneNumber : list-of-hashed-phone-numbers) {
  ContactInfo contactInfo = new ContactInfo();
  ArrayList<String> phoneNumberList = new ArrayList<String>();
  phoneNumberList.add(hashedPhoneNumber);
  contactInfo.setHashedPhoneNumbers(phoneNumberList);
  contactInfos.add(contactInfo);
}
contactInfoList.setContactInfos(contactInfos);

// Build consent object for passing consent if granted by the end user.
Consent consent =
    new Consent()
        .setAdUserData(ad-user-data-consent)
        .setAdPersonalization(ad-personalization-consent);
ContactInfoList.setConsent(consent);

// Assign contact info list to Customer Match audience.
customerMatchAudience.setContactInfoList(contactInfoList);

// Create Customer Match audience.
FirstAndThirdPartyAudience response =
    service
        .firstAndThirdPartyAudiences()
        .create(customerMatchAudience)
        .setAdvertiserId(advertiser-id)
        .execute();

// Display name of new audience.
System.out.printf(
    "Customer Match audience %s was created.",
    response.getName()
);

Python

# Build list of Contact Info objects
contact_infos = []
for hashed_phone_number in list-of-hashed-phone-numbers:
  contact_infos.append({'hashedPhoneNumbers': [hashed_phone_number]})

# Create a Customer Match first- and third-party audience object.
audience_obj = {
    'displayName': display-name,
    'firstAndThirdPartyAudienceType':
        'FIRST_AND_THIRD_PARTY_AUDIENCE_TYPE_FIRST_PARTY',
    'audienceType': 'CUSTOMER_MATCH_CONTACT_INFO',
    'membershipDurationDays': 10000,
    'contactInfoList': {
        'contactInfos': [
            contact_infos
        ],
        'consent': {
            'adUserData': ad-user-data-consent,
            'adPersonalization': ad-personalization-consent
        }
    }
}

# Build and execute request.
audience = service.firstAndThirdPartyAudiences().create(
    advertiserId=advertiser-id,
    body=audience_obj
).execute()

# Display name of new audience.
print('Customer Match audience %s was created.' % audience["name"])

PHP

// Create a Customer Match first- and third-party audience object.
$audience = new Google_Service_DisplayVideo_FirstAndThirdPartyAudience();
$audience->setDisplayName(display-name);
$audience->setFirstAndThirdPartyAudienceType(
    'FIRST_AND_THIRD_PARTY_AUDIENCE_TYPE_FIRST_PARTY'
);
$audience->setAudienceType('CUSTOMER_MATCH_CONTACT_INFO');
$audience->setMembershipDurationDays(10000);

// Build list of contact information objects.
$contactInfoList = new Google_Service_DisplayVideo_ContactInfoList();
$contactInfos = array();
foreach (list-of-hashed-phone-numbers as $hashedPhoneNumber) {
    $contactInfo = new Google_Service_DisplayVideo_ContactInfo();
    $contactInfo->setHashedPhoneNumbers(array($hashedPhoneNumber));
    $contactInfos[] = $contactInfo;
}
$contactInfoList->setContactInfos($contactInfos);

// Build consent object for passing consent if granted by the end user.
$consent = new Google_Service_DisplayVideo_Consent();
$consent->setAdUserData(ad-user-data-consent);
$consent->setAdPersonalization(ad-personalization-consent);
$contactInfoList->setConsent($consent);

// Assign contactInfoList to audience object.
$audience->setContactInfoList($contactInfoList);

// Call the API, creating the audience.
$result = $this->service->firstAndThirdPartyAudiences->create(
    $audience,
    array('advertiserId' => advertiser-id)
);

// Display name of new audience.
printf('Customer Match audience %s was created.', $result['name']);

Müşteri Eşleştirme kitlesinin üyeliğini güncelleme

Hedeflemek istediğiniz ek müşteriler belirlediyseniz, müşterilerin mevcut kitle üyeliklerini yenilemeniz gerekiyorsa veya müşterileri bir kitleden çıkarmak istiyorsanız mevcut bir Müşteri Eşleştirme kitlesinin müşteri verilerini firstAndThirdPartyAudiences.editCustomerMatchMembers yöntemiyle güncelleyebilirsiniz. added_members birleştirme alanını kullanarak bir listeye müşteri ekleyebilir ve removed_members birleştirme alanını kullanarak müşterileri listeden çıkarabilirsiniz.

Tek bir firstAndThirdPartyAudiences.editCustomerMatchMembers isteği, yalnızca listeye üye ekleyebilir veya listeden üye kaldırabilir. Her ikisinin de yapılmaya çalışılması INVALID_ARGUMENT hatasına neden olur.

Aşağıda, sağlanan posta adresi verilerini kullanarak tek bir müşteriyi mevcut iletişim bilgileri Müşteri Eşleştirme kitlesine üye olarak nasıl ekleyeceğinize dair bir örnek verilmiştir:

Java

// Create an edit members request object.
EditCustomerMatchMembersRequest editCustomerMatchMembersRequest =
    new EditCustomerMatchMembersRequest()
        .setAdvertiserId(advertiser-id);

// Build contact information object to add to audience.
ContactInfoList contactInfoList = new ContactInfoList();
ArrayList<ContactInfo> contactInfos = new ArrayList<ContactInfo>();
ContactInfo contactInfo =
    new ContactInfo()
        .setHashedFirstName(hashed-customer-first-name)
        .setHashedLastName(hashed-customer-last-name)
        .setZipCodes(customer-zip-codes-list)
        .setCountryCode(customer-country-code);
contactInfos.add(contactInfo);
contactInfoList.setContactInfos(contactInfos);

// Build consent object for passing consent if granted by the end user.
Consent consent =
    new Consent()
        .setAdUserData(ad-user-data-consent)
        .setAdPersonalization(ad-personalization-consent);
ContactInfoList.setConsent(consent);

// Assign contact info list to request body.
editCustomerMatchMembersRequest.setAddedContactInfoList(contactInfoList);

// Edit Customer Match audience membership.
EditCustomerMatchMembersResponse response =
    service
        .firstAndThirdPartyAudiences()
        .editCustomerMatchMembers(
            audience-id,
            editCustomerMatchMembersRequest
        )
        .execute();

// Display ID of updated audience.
System.out.printf(
    "The membership of Customer Match audience ID %s was edited.",
    response.getFirstAndThirdPartyAudienceId()
);

Python

# Create an edit members request object.
edit_member_request_obj = {
    'advertiserId': advertiser-id,
    'addedContactInfoList': {
        'contactInfos': [
            {
                'hashedFirstName': hashed-customer-first-name,
                'hashedLastName': hashed-customer-last-name,
                'countryCode': customer-country-code,
                'zipCodes': customer-zip-codes-list
            }
        ],
        'consent': {
          'adUserData': ad-user-data-consent,
          'adPersonalization': ad-personalization-consent
        }
    }
}

# Build and execute request.
response = service.firstAndThirdPartyAudiences().editCustomerMatchMembers(
    firstAndThirdPartyAudienceId=audience-id,
    body=edit_member_request_obj
).execute()

# Display ID of updated audience.
print('The membership of the Customer Match audience ID %s was updated.'
      % response["firstAndThirdPartyAudienceId"])

PHP

// Create an edit members request object.
$editMemberRequest =
    new Google_Service_DisplayVideo_EditCustomerMatchMembersRequest();
$editMemberRequest->setAdvertiserId(advertiser-id);

// Build contact information object to add to audience.
$contactInfoList = new Google_Service_DisplayVideo_ContactInfoList();
$contactInfos = array();
$contactInfo = new Google_Service_DisplayVideo_ContactInfo();
$contactInfo->setHashedFirstName(hashed-customer-first-name);
$contactInfo->setHashedLastName(hashed-customer-last-name);
$contactInfo->setCountryCode(customer-country-code);
$contactInfo->setZipCodes(array(customer-zip-codes-list));
$contactInfos[] = $contactInfo;
$contactInfoList->setContactInfos($contactInfos);

// Build consent object for passing consent if granted by the end user.
$consent = new Google_Service_DisplayVideo_Consent();
$consent->setAdUserData(ad-user-data-consent);
$consent->setAdPersonalization(ad-personalization-consent);
$contactInfoList->setConsent($consent);

// Assign contactInfoList to edit members request body.
$editMemberRequest->setAddedContactInfoList($contactInfoList);

// Call the API, editing the audience membership.
$response = $this
    ->service
    ->firstAndThirdPartyAudiences
    ->editCustomerMatchMembers(
        audience-id,
        $editMemberRequest
    );

// Display ID of updated audience.
printf(
    'The membership of Customer Match audience ID %s was edited',
    $result['firstAndThirdPartyAudienceId']
);