Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(integration): marketo - correct attribute to attributes #1446

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions __tests__/data/marketo_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [],
"attributes": [],
"leadId": 4,
"primaryAttributeValue": "Test Product"
}
Expand Down Expand Up @@ -75,7 +75,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [
"attributes": [
{
"apiName": "productId",
"value": "prod_1"
Expand Down Expand Up @@ -108,7 +108,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [],
"attributes": [],
"leadId": 4,
"primaryAttributeValue": "Test Product"
}
Expand Down
4 changes: 2 additions & 2 deletions __tests__/data/marketo_router_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [],
"attributes": [],
"leadId": 4,
"primaryAttributeValue": "Test Product"
}
Expand Down Expand Up @@ -135,7 +135,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [],
"attributes": [],
"leadId": 4,
"primaryAttributeValue": "Test Product"
}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/data/sanity/marketo_router_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"activityDate": "2020-12-17T21:00:59.176Z",
"activityTypeId": 100001,
"attribute": [],
"attributes": [],
"leadId": 4,
"primaryAttributeValue": "Test Product"
}
Expand Down
6 changes: 3 additions & 3 deletions v0/destinations/marketo/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,13 @@ const processTrack = async (message, formattedDestination, token) => {
const leadId = await getLeadId(message, formattedDestination, token);

// handle custom activy attributes
const attribute = [];
const attributes = [];
Object.keys(customActivityPropertyMap).forEach(key => {
// exclude the primaryKey
if (key !== primaryKeyPropName) {
const value = message.properties[key];
if (isDefined(value)) {
attribute.push({ apiName: customActivityPropertyMap[key], value });
attributes.push({ apiName: customActivityPropertyMap[key], value });
}
}
});
Expand All @@ -480,7 +480,7 @@ const processTrack = async (message, formattedDestination, token) => {
{
activityDate: getFieldValueFromMessage(message, "timestamp"),
activityTypeId: Number.parseInt(activityTypeId, 10),
attribute,
attributes,
leadId,
primaryAttributeValue
}
Expand Down