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: update pinterest_tag single product events with new mapping #3858

Merged
merged 8 commits into from
Nov 18, 2024
Prev Previous commit
Next Next commit
chore: update integrations-lib library
  • Loading branch information
ItsSudip committed Nov 11, 2024
commit 5c0b692130608853c7974aad21dd55305d717cdc
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@
"@koa/router": "^12.0.0",
"@ndhoule/extend": "^2.0.0",
"@pyroscope/nodejs": "^0.2.9",
"@rudderstack/integrations-lib": "^0.2.10",
"@rudderstack/integrations-lib": "^0.2.13",
"@rudderstack/json-template-engine": "^0.18.0",
"@rudderstack/workflow-engine": "^0.8.13",
"@shopify/jest-koa-mocks": "^5.1.1",
41 changes: 20 additions & 21 deletions src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -69,8 +69,8 @@ steps:
"event_id": $.getOneByPaths(., ^.destination.Config.deduplicationKey) ?? .messageId,
"app_id": ^.destination.Config.appId,
"advertiser_id": ^.destination.Config.advertiserId,
"partner_name": .properties.partnerName ? $.toString(.properties.partnerName) : undefined,
"device_carrier": .properties.partnerName ? $.toString(.context.network.carrier) : undefined,
"partner_name": .properties.partnerName ? $.convertToString(.properties.partnerName) : undefined,
"device_carrier": .properties.partnerName ? $.convertToString(.context.network.carrier) : undefined,
"wifi": .context.network.wifi ? Boolean(.context.network.wifi) : undefined
});
$.outputs.apiVersion === {{$.API_VERSION.v5}} ? commonFields = commonFields{~["advertiser_id"]};
@@ -109,7 +109,7 @@ steps:
"client_user_agent": .context.userAgent,
"external_id": {{{{$.getGenericPaths("userId")}}}},
"click_id": .properties.clickId,
"partner_id": .traits.partnerId ?? .context.traits.partnerId ? $.toString(.traits.partnerId ?? .context.traits.partnerId) : undefined
"partner_id": .traits.partnerId ?? .context.traits.partnerId ? $.convertToString(.traits.partnerId ?? .context.traits.partnerId) : undefined
});
!.destination.Config.sendExternalId ? userFields = userFields{~["external_id"]} : null;
userFields = $.removeUndefinedAndNullAndEmptyValues(userFields);
@@ -127,20 +127,19 @@ steps:
steps:
- name: customFields
template: |
console.log('Stringified contentName',toString)
const customFields = .message.().({
"currency": .properties.currency,
"value": .properties.value !== undefined ? $.toString(.properties.value) :
.properties.total !== undefined ? $.toString(.properties.total) :
.properties.revenue !== undefined ? $.toString(.properties.revenue) : undefined,
"value": .properties.value !== undefined ? $.convertToString(.properties.value) :
.properties.total !== undefined ? $.convertToString(.properties.total) :
.properties.revenue !== undefined ? $.convertToString(.properties.revenue) : undefined,
"num_items": .properties.numOfItems && Number(.properties.numOfItems),
"order_id": .properties.order_id,
"search_string": .properties.query,
"opt_out_type": .properties.optOutType,
"content_name": .properties.contentName ? $.toString(.properties.contentName) : undefined,
"content_category": .properties.contentCategory ? $.toString(.properties.contentCategory) : undefined,
"content_brand": .properties.contentBrand ? $.toString(.properties.contentBrand) : undefined,
"np": .properties.np ? $.toString(.properties.np) : undefined
"content_name": .properties.contentName ? $.convertToString(.properties.contentName) : undefined,
"content_category": .properties.contentCategory ? $.convertToString(.properties.contentCategory) : undefined,
"content_brand": .properties.contentBrand ? $.convertToString(.properties.contentBrand) : undefined,
"np": .properties.np ? $.convertToString(.properties.np) : undefined
});
$.removeUndefinedValues(customFields)

@@ -154,11 +153,11 @@ steps:
"content_ids": products.(.product_id ?? .sku ?? .id)[],
"contents": [email protected].({
"quantity": Number(.quantity ?? prop.quantity ?? 1),
"item_price": $.toString(.price ?? prop.price),
"item_name": $.toString(.name),
"id": .product_id ?? .sku ? $.toString(.product_id ?? .sku) : undefined,
"item_category": .category ? $.toString(.category) : undefined,
"item_brand": .brand ? $.toString(.brand) : undefined
"item_price": $.convertToString(.price ?? prop.price),
"item_name": $.convertToString(.name),
"id": .product_id ?? .sku ? $.convertToString(.product_id ?? .sku) : undefined,
"item_category": .category ? $.convertToString(.category) : undefined,
"item_brand": .brand ? $.convertToString(.brand) : undefined
})[]
}
else:
@@ -170,11 +169,11 @@ steps:
"content_ids": (props.product_id ?? props.sku ?? props.id)[],
"contents": {
"quantity": Number(props.quantity) || 1,
"item_price": props.price ? $.toString(props.price),
"item_name": props.name ? $.toString(props.name),
"id": props.product_id ?? props.sku ? $.toString(props.product_id ?? props.sku) : undefined,
"item_category": props.category ? $.toString(props.category) : undefined,
"item_brand": props.brand ? $.toString(props.brand) : undefined
"item_price": props.price ? $.convertToString(props.price),
"item_name": props.name ? $.convertToString(props.name),
"id": props.product_id ?? props.sku ? $.convertToString(props.product_id ?? props.sku) : undefined,
"item_category": props.category ? $.convertToString(props.category) : undefined,
"item_brand": props.brand ? $.convertToString(props.brand) : undefined
}[]
};
- name: combineAllEcomFields
Loading