Google Ads API consultant needed

72 views
Skip to first unread message

Tim Ritchie

unread,
Apr 17, 2023, 5:57:55 PM4/17/23
to Google Ads API and AdWords API Forum
Who can you recommend?

We are looking for a consultant to help us with the Google Ads REST API. The goal is to find the correct endpoint to add a user to Customer List created in the Audience Manager. These updates will need to be pushed in real time if possible. We are trying to stick to using the REST API only and will be willing to fall back to the C# library if necessary. We would like to have a full example and a walkthrough of how this API would work and any limitations that could potentially occur.

Google Ads API Forum Advisor

unread,
Apr 18, 2023, 4:47:51 AM4/18/23
to t...@integrateiq.com, adwor...@googlegroups.com
Hi Tim,

Thank you for raising this concern to the Google Ads API support team.

Regarding your concern, it appears that this is specifically about customer match. You may refer to our Customer Match documentation for more details about this. Let me provide you steps with sample code.

You will need to create first a userlist.
Sample code:
curl -X POST "https://googleads.googleapis.com/$(version)/customers/$CustomerID)/userLists:mutate" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'operations': [
{
'create': {
'crmBasedUserList': {
'uploadKeyType': 'CONTACT_INFO'
},
'name': 'Customer Match list $(date)',
'description': 'A list of customers that originated from email addresses',
'membershipLifeSpan': 30
}
}
]

# Substitute ${USER_LIST_RESOURCE_NAME} with the user list resource name
# returned when creating the user list in the last step.

And then you will need to create an offlineuserdatajob to upload data.
curl -X POST "https://googleads.googleapis.com/$(version)/customers/$CustomerID)//offlineUserDataJobs:create" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'job': {
'type': 'CUSTOMER_MATCH_USER_LIST',
'customerMatchUserListMetadata': {
'userList': '${USER_LIST_RESOURCE_NAME}'
}
}
}"

Lastly, you will need to use the offlineUserDataJobs.addOperations to Add operations to the offline user data job.

# Substitute ${OFFLINE_USER_DATA_JOB_ID} with the offline user data
# job ID (a long number) returned when creating the job in the last step.
# Uploads email, first name, last name, and address data to the job.
# Note: Emails, first names, and last names must be SHA-256 encoded.
 
curl -X POST "https://googleads.googleapis.com/$(version)/customers/$CustomerID)/offlineUserDataJobs/${OFFLINE_USER_DATA_JOB_ID}:addOperations" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${LOGIN_CUSTOMER_ID}" \
--data "{
'operations': {
'create': {
'userIdentifiers': {
'hashedEmail': 'REDACTED'
}
}
},
'operations': {
'create': {
'userIdentifiers': {
'addressInfo': {
'hashedFirstName': 'REDACTED',
'hashedLastName': 'REDACTED',
'countryCode': 'US',
'postalCode': '10011'
}
}
}
},
'enablePartialFailure': 'true'
}"

To check your offlineuserdatajob's status, you may use the offline_user_data_job report.

Let us know how it goes on your end.

Links included in this email:
Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2knQ1s:ref
Reply all
Reply to author
Forward
0 new messages