NUTRINTG Google/Youtube Lead Ads
Overview:
The purpose of this integration is to send data from google ads lead forms to CDS/CDP depending on provided configuration.
https://developers.google.com/google-ads/webhook/docs/implementation - documentation from google
FAQ:
Webhook’s listener urls, test: https://api.cdp-rb.com/test/leadads/youtube, stage: https://api.cdp-rb.com/stage/leadads/youtube, prod: https://api.cdp-rb.com/leadads/youtube
No headers are required
Data lands in CDP or CDS based on logic used in profile service and configuration
Jira template :
Field | Value | Required |
---|---|---|
Campaign ID |
| Yes |
Google Key |
| Yes |
Country Code |
| Yes |
Tier Code |
| Yes |
Agreements( at least BusinessId and RevisionId) |
| Yes |
Fields Sent |
| No |
Technology:
Written using mule4
Using cdd-mule4-commons for correlation Id functionality
No Spring used in this service
Custom java code written for field decryption (from mongoDB)
Mule4 secure properties module together with global elements used for property encryption/decryption (AES based at the moment)
Payloads:
Service accepts following fields in payload for listener:
{
campaign_id: ““, (REQUIRED)
google_key, ““, (REQUIRED)
user_column_data: [
{
user_column_data.column_id: “FIRST_NAME“
},
{
user_column_data.column_id: “LAST_NAME“
},
{
user_column_data.column_id: “EMAIL“ (REQUIRED)
},
{
user_column_data.column_id: “POSTAL_CODE“
},
{
user_column_data.column_id: “CITY“
},
{
user_column_data.column_id: “STREET_ADDRESS“
},
{
user_column_data.column_id: “PHONE_NUMBER“
}
]
}
Payload sent to profile service:
{
FirstName: ““,
LastName: ““,
TierCode: ““,
CompanyName: ““,
Addresses: [{
PostalCode: ““,
City: ““,
AddressLine1: ““,
CountryCode: ““,
DeliveryStatus: ““
}],
Phones: [{
PhoneNumber: ““,
DeliveryStatus: ““
}],
Emails: [{
EmailAddress: ““,
DeliveryStatus: ““
}],
"JsonExternalData": {
"Agreements": ““
}
}
Data stored in mongoDB collection:
{
"_id" : "", (CAMPAING ID EQUIVALENT)
"googleKey" : "", (ENCRYPTED, using standard for us AES encryption with enchleper tool)
"programCode" : "",
"brandOrgCode" : "",
"accountSource" : "",
"countryCode" : "",
"deliveryStatus" : "“,
"tierCode" : "", (REQUIRED FOR CDP SEND)
"agreements" : [
{
"BusinessId" : "“,
"RevisionId" : "",
"ConsentAcceptedInd" : booleanValue,
"ConsentDesc" : "",
"MandatoryInd" : booleanValue,
"AgreementDate" : "2018-05-23 12:29:04",
"ActivityDate" : "2017-07-02T12:37:11.3665418Z",
"Status" : "A"
}
]
}
Functional and technical overview:
Message road is pretty straight forward: Following steps are being performed:
Google Ads Webhook sends request to https://api.cdp-rb.com/<environment>/leadads/youtube
Leads Ads Service receives the message, sets correlation ID and fetches data corresponding to the campaignID from MongoDB.
Lead ads service validates if provided google key matches the one stored In mongo
Lead ads transforms message to match profile service expected payload
Lead ads service sends message to profiel service via internal cloud address
Leads ads service validates response code from profile service
Profile service handles message based on it’s well known logic.
Testing
In order to test you have to configure lead form extension on your campaign in google ads. Than you can use SEND TEST DATA option from configuration
Google requires response code 200 for proper request.
Otherwise you can use custom request from payload. No specific headers required
Example working mongo configuration for:
CDS:
{
"_id" : "12260105699",
"googleKey" : "ugfMOMVmvF0mjYhDotc4jg==", (encrypted value of phrase: “testkey”)
"programCode" : "YTGBN",
"brandOrgCode" : "YTGBN",
"accountSource" : "YTGBN",
"countryCode" : "GBE",
"deliveryStatus" : "G",
"tierCode" : "YTGBN",
"agreements" : [
{
"BusinessId" : "LT-TC-CA-en-durex-test_first_test",
"RevisionId" : "5f02eb0701dab100013dd861",
"ConsentAcceptedInd" : false,
"ConsentDesc" : "Consent Description",
"MandatoryInd" : false,
"AgreementDate" : "2018-05-23 12:29:04",
"ActivityDate" : "2017-07-02T12:37:11.3665418Z",
"Status" : "A"
}
]
}
CDP:
{
"_id" : "12260105699",
"googleKey" : "ugfMOMVmvF0mjYhDotc4jg==", (encrypted value of phrase: “testkey”)
"programCode" : "RBCANMCN",
"brandOrgCode" : "RBCANMCN",
"accountSource" : "CANMCNHUSK",
"countryCode" : "CAN",
"deliveryStatus" : "G",
"tierCode" : "RBCANMCNTIER1",
"agreements" : [
{
"BusinessId" : "LT-TC-CA-en-durex-test_first_test",
"RevisionId" : "5f02eb0701dab100013dd861",
"ConsentAcceptedInd" : false,
"ConsentDesc" : "Consent Description",
"MandatoryInd" : false,
"AgreementDate" : "2018-05-23 12:29:04",
"ActivityDate" : "2017-07-02T12:37:11.3665418Z",
"Status" : "A"
}
]
}