Skip to content

Commit

Permalink
Add missing flush of the ecommerce object
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Jan 3, 2024
1 parent 4115ed9 commit d3efb92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/integration/woocommerce.js

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

1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1
#### Enhancements:

#### Bugfixes:
* Added missing flush of the ecommerce object on the select_item event.

#### Other:

Expand Down
2 changes: 2 additions & 0 deletions src/js/woocommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ function gtmkitLoad() {

if (!itemData) return true;

window[datalayerName].push({ ecommerce: null });
window[datalayerName].push({
event: 'remove_from_cart',
ecommerce: {
Expand Down Expand Up @@ -321,6 +322,7 @@ function gtmkitLoad() {

if (!itemData) return true;

window[datalayerName].push({ ecommerce: null });
window[datalayerName].push({
event: 'select_item',
ecommerce: {
Expand Down

0 comments on commit d3efb92

Please sign in to comment.