1. Home
  2. Cookieless Web Analytics
  3. How to track webpages made with REACT

How to track webpages made with REACT

  1. Add SEAL’s tracking pixel to all your website pages.

<script>
 /* SealMetrics Tracker Code */
 var oSm = window.oSm || {};
 oSm.account = 'XXXXXXXXXXXXX';
 oSm.event = 'pageview';
 !function(e){var t="//app.sealmetrics.com/tag/tracker";window.oSm=oSm,window.smTrackerLoaded?sm.tracker.track(e.event):Promise.all([new Promise(function(e){var n=document.createElement("script");n.src=t,n.async=!0,n.onload=function(){e(t)},document.getElementsByTagName("head")[0].appendChild(n)})]).then(function(){sm.tracker.track(e.event)})}(oSm);
 /* End SealMetrics Tracker Code */
</script>

2. Once a user submits the form or makes a conversion, this code should be triggered:

<script>
/* SealMetrics Tracker Code */
var oSm = window.oSm || {};
 oSm.event = 'conversion';
 oSm.label = 'purchase';
 oSm.amount = '1.01';
 !function(e){var t="//app.sealmetrics.com/tag/tracker";window.oSm=oSm,window.smTrackerLoaded?sm.tracker.track(e.event):Promise.all([new Promise(function(e){var n=document.createElement("script");n.src=t,n.async=!0,n.onload=function(){e(t)},document.getElementsByTagName("head")[0].appendChild(n)})]).then(function(){sm.tracker.track(e.event)})}(oSm);
/* End SealMetrics Tracker Code */
</script>

You can trigger each pixel with the order you want.
Updated on julio 21, 2022

Was this article helpful?

Related Articles