Skip to content

Commit

Permalink
Merge pull request #51 from stape-io/added-support-of-x-fb-cd-content…
Browse files Browse the repository at this point in the history
…_type
  • Loading branch information
Bukashk0zzz authored Jul 5, 2024
2 parents 85bbaa1 + c596233 commit ee6a5bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
homepage: 'https://stape.io/'
versions:
- sha: 1ab4ccc09f86a65f2e2256b862f2b47f851b9075
changeNotes: Added support of x-fb-cd-content_type.
- sha: e1e5321231eaa46c13b397d5cedaa207ecefa7a8
changeNotes: Update to API v20 & use content_type from eventData.
- sha: f0df06cb4531b25e8799aacdc5eb04a537293d96
Expand Down
3 changes: 2 additions & 1 deletion template.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ function addEcommerceData(eventData, mappedData) {

if (eventData.items && eventData.items[0]) {
mappedData.custom_data.contents = [];
mappedData.custom_data.content_type = eventData.content_type || 'product';
mappedData.custom_data.content_type =
eventData['x-fb-cd-content_type'] || eventData.content_type || 'product';
currencyFromItems = eventData.items[0].currency;

if (!eventData.items[1]) {
Expand Down
3 changes: 2 additions & 1 deletion template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,8 @@ function addEcommerceData(eventData, mappedData) {
if (eventData.items && eventData.items[0]) {
mappedData.custom_data.contents = [];
mappedData.custom_data.content_type = eventData.content_type || 'product';
mappedData.custom_data.content_type =
eventData['x-fb-cd-content_type'] || eventData.content_type || 'product';
currencyFromItems = eventData.items[0].currency;
if (!eventData.items[1]) {
Expand Down

0 comments on commit ee6a5bb

Please sign in to comment.