Skip to content

Commit

Permalink
added reset
Browse files Browse the repository at this point in the history
  • Loading branch information
gvidoou committed Oct 21, 2024
1 parent 43e8565 commit d9c516d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ <h1>GTM mock!</h1>
</div>

</div>
<div class="row p-3">
<div class="col">
<a type="button" class="btn btn-danger" href="#" onclick="pushEvent('reset')">Reset datalayer</a>
</div>
<!-- <div class="col">
<a type="button" class="btn btn-warning" href="#" onclick="pushEvent('')"></a>
</div>
<div class="col">
<a type="button" class="btn btn-warning" href="#" onclick="pushEvent('')"></a>
</div> -->
</div>

<div class="row-fluid pt-5">
<div class="col">
<div class="card">
Expand Down Expand Up @@ -304,11 +316,19 @@ <h1>GTM mock!</h1>
value: 69.9
},
});
} else if (event_name === 'reset') {
window.dataLayer.push(function() {
this.reset();
});
dataLayer.push({
event: 'reset',
});
}

log(event_name + ' event sent');
}

</script>
<script src=bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>

0 comments on commit d9c516d

Please sign in to comment.