Prześlij listy odbiorców z kierowania na listę klientów

Możesz tworzyć odbiorców z kierowania na listę klientów na podstawie przesłanych danych kontaktowych klientów. informacji i identyfikatorów urządzeń mobilnych za pomocą funkcji Display & Interfejs Video 360 API. Na tej stronie dowiesz się, aby utworzyć początkową listę odbiorców z kierowania na listę klientów i dołączyć nowe dane klienta do dotychczasowych odbiorców za pomocą sieci reklamowej Interfejs Video 360 API.

Przygotowywanie danych użytkownika

Dane użytkownika służące do wypełniania list odbiorców z kierowania na listę klientów mają charakter poufny i wymagają należy przygotować się do przesłania.

Haszowanie danych wrażliwych

Niektóre listy odbiorców z kierowania na listę klientów są tworzone na podstawie poufnych informacji kontaktowych klientów i informacjami o nich. Reklamy displayowe i Usługa Video 360 wymaga, by dane wrażliwe były zaszyfrowane za pomocą algorytm SHA256 przed przesłaniem, Te pola danych muszą być zaszyfrowane przed przesłaniem:

  • Imię
  • Nazwisko
  • Adresy e-mail
  • Numery telefonów

Kodów pocztowych i krajowych nie należy szyfrować przed przesłaniem. Próba przesłanie niezaszyfrowanych danych klientów spowoduje błąd.

Przed zaszyfrowaniem danych upewnij się, że spełnione są te warunki:

  • Z imienia, nazwiska i adresu e-mail należy usunąć spacje .
  • Wszystkie wartości muszą być zapisane małymi literami.
  • Wszystkie numery telefonów muszą być sformatowane w formacie E.164, zawierać numer kierunkowy kraju.

Przesyłając dane użytkownika, użyj pól consent w podanym formularzu. ContactInfoList lub MobileDeviceIdList obiekty do przekazywania sygnałów zgody; przyznanych przez uwzględnionych użytkowników.

Ustawienie dowolnego pola w obiekcie Consent na CONSENT_STATUS_DENIED powoduje błąd.

Sygnały dotyczące zgody są ustawiane dla wszystkich użytkowników dodanych w jednym firstAndThirdPartyAudiences.create lub firstAndThirdPartyAudiences.editCustomerMatchMembers użytkownika. Użytkowników z różnymi sygnałami dotyczącymi zgody należy przesłać oddzielnie żądań.

Tworzenie listy odbiorców z kierowania na listę klientów

Listę odbiorców z kierowania na listę klientów możesz utworzyć za pomocą firstAndThirdPartyAudiences.create. Odbiorcy muszą zostały zadeklarowane jako własne listy odbiorców i muszą mieć parametr audienceType z CUSTOMER_MATCH_CONTACT_INFO lub CUSTOMER_MATCH_DEVICE_ID. Dane kierowania na listę klientów muszą być: należy podać za pomocą odpowiedniego pola w polu sumy members

Oto przykład tworzenia nowych informacji kontaktowych na potrzeby kierowania na listę klientów odbiorców z nieograniczonym okresem członkostwa na podstawie podanej listy zaszyfrowanych Numery telefonów:

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']);

Aktualizowanie członkostwa odbiorców z kierowania na listę klientów

Jeśli masz już określonych klientów, na których chcesz kierować reklamy, odnowić konta klientów obecnych odbiorców lub chcesz ich usunąć na liście odbiorców można zaktualizować dane dotychczasowego klienta, Dopasuj odbiorców do firstAndThirdPartyAudiences.editCustomerMatchMembers . Aby dodać klientów do listy, użyj: added_members i usunąć klientów z z polem sumowania removed_members.

Jeden firstAndThirdPartyAudiences.editCustomerMatchMembers może tylko dodawać członków do listy lub ich z niej usuwać. Pojedyncza próba spowoduje to wystąpienie błędu INVALID_ARGUMENT.

Oto przykład, jak dodać jednego klienta jako członka do istniejącego dane kontaktowe odbiorców z kierowania na listę klientów na podstawie podanego adresu pocztowego:

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']
);