-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update pinterest_tag single product events with new mapping (#3858
) * feat: update pinterest_tag single product events with new mapping * chore: use toString function from integrations-lib * chore: update integrations-lib library
- Loading branch information
Showing
12 changed files
with
94 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ bindings: | |
path: ../../../../v0/util | ||
- name: validateEventName | ||
path: ../../../../v0/util | ||
- path: '@rudderstack/integrations-lib' | ||
|
||
steps: | ||
- name: checkIfProcessed | ||
condition: .message.statusCode | ||
|
@@ -67,9 +69,9 @@ steps: | |
"event_id": $.getOneByPaths(., ^.destination.Config.deduplicationKey) ?? .messageId, | ||
"app_id": ^.destination.Config.appId, | ||
"advertiser_id": ^.destination.Config.advertiserId, | ||
"partner_name": .properties.partnerName, | ||
"device_carrier": .context.network.carrier, | ||
"wifi": .context.network.wifi | ||
"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"]}; | ||
$.removeUndefinedValues(commonFields) | ||
|
@@ -107,7 +109,7 @@ steps: | |
"client_user_agent": .context.userAgent, | ||
"external_id": {{{{$.getGenericPaths("userId")}}}}, | ||
"click_id": .properties.clickId, | ||
"partner_id": .traits.partnerId ?? .context.traits.partnerId | ||
"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,17 +129,17 @@ steps: | |
template: | | ||
const customFields = .message.().({ | ||
"currency": .properties.currency, | ||
"value": .properties.value !== undefined ? String(.properties.value) : | ||
.properties.total !== undefined ? String(.properties.total) : | ||
.properties.revenue !== undefined ? String(.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, | ||
"content_category": .properties.contentCategory, | ||
"content_brand": .properties.contentBrand, | ||
"np": .properties.np | ||
"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) | ||
|
@@ -151,11 +153,11 @@ steps: | |
"content_ids": products.(.product_id ?? .sku ?? .id)[], | ||
"contents": [email protected].({ | ||
"quantity": Number(.quantity ?? prop.quantity ?? 1), | ||
"item_price": String(.price ?? prop.price), | ||
"item_name": String(.name), | ||
"id": .product_id ?? .sku, | ||
"item_category": .category, | ||
"item_brand": .brand | ||
"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: | ||
|
@@ -167,7 +169,11 @@ steps: | |
"content_ids": (props.product_id ?? props.sku ?? props.id)[], | ||
"contents": { | ||
"quantity": Number(props.quantity) || 1, | ||
"item_price": String(props.price) | ||
"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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters