Skip to content

Commit

Permalink
Update to API v20 & use content_type from eventData
Browse files Browse the repository at this point in the history
  • Loading branch information
kHorozhanov committed Jul 4, 2024
1 parent bf333cc commit e1e5321
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions template.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (fbp) {
setCookie('_fbp', fbp, cookieOptions);
}

const apiVersion = '19.0';
const apiVersion = '20.0';
let pixelIdsAndAccessTokens = [
{ pixelId: data.pixelId, accessToken: data.accessToken }
];
Expand Down Expand Up @@ -424,7 +424,7 @@ function addEcommerceData(eventData, mappedData) {

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

if (!eventData.items[1]) {
Expand Down
4 changes: 2 additions & 2 deletions template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ if (fbp) {
setCookie('_fbp', fbp, cookieOptions);
}

const apiVersion = '19.0';
const apiVersion = '20.0';
let pixelIdsAndAccessTokens = [
{ pixelId: data.pixelId, accessToken: data.accessToken }
];
Expand Down Expand Up @@ -1158,7 +1158,7 @@ function addEcommerceData(eventData, mappedData) {
if (eventData.items && eventData.items[0]) {
mappedData.custom_data.contents = [];
mappedData.custom_data.content_type = 'product';
mappedData.custom_data.content_type = eventData.content_type || 'product';
currencyFromItems = eventData.items[0].currency;
if (!eventData.items[1]) {
Expand Down

0 comments on commit e1e5321

Please sign in to comment.