How to Install the Page View Script for BigCommerce
This guide will assist you with implementing the Snap Pixel on BigCommerce.
Important: Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with your Pixel ID. Your Pixel ID can be found in the snaptr('init','xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') portion of your script.
How to Install the Page View Script
-
Log in to your BigCommerce account at https://login.bigcommerce.com/login.
-
In the navigation bar on the left-hand sign, select Storefront.
-
Choose Script Manager.
-
Click Create a Script.
-
Configure your script as the following:
-
Name of Script (Required): Enter a name for your script (e.g. Snap Page View Pixel).
-
Description (Optional): A description of your script (e.g. Page View).
-
Location on page: Select Head.
-
Select pages where script will be added: Select All Pages.
-
Script type: Script.
-
Copy and paste the pixel script example from below into the Scripts Contents box.
-
Click Save
Page View Scripts
This script will report a page view event for each page of your store.
<!-- Snap Pixel Code -->
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'https://sc-static.net/scevent.min.js');
snaptr('init','xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
snaptr('track','PAGE_VIEW');
</script>
<!-- End Snap Pixel Code -->
