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

content_type should not be set when items is undefined #18

Merged
merged 2 commits into from
Nov 28, 2023
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
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: 0d86e9a4a5fc5add1109cf5b1a8b9f020a862dcf
changeNotes: Content type fix.
- sha: 552235408d50a3b7228d649e1437b0b0600da428
changeNotes: Added ability to generate _ttp cookie if not exists.
- sha: f635ee4f83d084cc2328b0040fc6f5ca7a4bb6a1
Expand Down
2 changes: 1 addition & 1 deletion template.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function addPropertiesData(eventData, mappedData) {
mappedData.properties = {};

if (eventData.content_type) mappedData.properties.content_type = eventData.content_type;
else mappedData.properties.content_type = 'product';
else if (eventData.items && eventData.items[0]) mappedData.properties.content_type = 'product';

if (eventData.currency) mappedData.properties.currency = eventData.currency;

Expand Down
2 changes: 1 addition & 1 deletion template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ function addPropertiesData(eventData, mappedData) {
mappedData.properties = {};

if (eventData.content_type) mappedData.properties.content_type = eventData.content_type;
else mappedData.properties.content_type = 'product';
else if (eventData.items && eventData.items[0]) mappedData.properties.content_type = 'product';

if (eventData.currency) mappedData.properties.currency = eventData.currency;

Expand Down
Loading