Skip to content

Commit

Permalink
Merge pull request #24 from stape-io/fix-use-optimistic-scenario
Browse files Browse the repository at this point in the history
Fix useOptimisticScenario
  • Loading branch information
Bukashk0zzz authored May 23, 2024
2 parents df433c0 + 16704ae commit 21d023b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 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: 1b2f1fc426f1a7265d462007563cf0861d6600e8
changeNotes: Fix useOptimisticScenario.
- sha: 08869b97a6326f7168c571d5729e820e8753ad28
changeNotes: Switch mapping of purchase events to CompletePayment.
- sha: 8349b1683ead309df1c9472d01a29a801ff3dd85
Expand Down
4 changes: 4 additions & 0 deletions template.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ sendHttpRequest(
JSON.stringify(postBody)
);

if (data.useOptimisticScenario) {
data.gtmOnSuccess();
}

function mapEvent(eventData, data) {
let eventSource = data.eventSource || 'web';
let mappedData = {
Expand Down
4 changes: 4 additions & 0 deletions template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@ sendHttpRequest(
JSON.stringify(postBody)
);

if (data.useOptimisticScenario) {
data.gtmOnSuccess();
}

function mapEvent(eventData, data) {
let eventSource = data.eventSource || 'web';
let mappedData = {
Expand Down

0 comments on commit 21d023b

Please sign in to comment.