Installation Snippet

The installation snippet is the <script> tag of JavaScript presented by Center to initiate and expose the center tracking on the page. We recommend that this script be placed into the <head> of the pages to be tracked.

<script>
  (function(a,c,d,b,e,f){a[d]=b;a[b]||(a[b]=function(){a[b].q=a[b].q||[];a[b].q.push(arguments)},d=c.createElement(e),d.async=!0,d.src=f,c=c.getElementsByTagName(e)[0],c.parentNode.insertBefore(d,c))})(window,document,"LeadPagesCenterObject","center","script","https://js.center.io/center.js");
  center('create', 'YOUR_PID_GOES_HERE', 'SiteName', {
    captureEmailForms: true
  });
  center('SiteName.send', 'view');
</script>

This code does four things:

  1. Creates a <script> element that starts asynchronously downloading the center.js JavaScript library from https://js.center.io/center.js.

  2. Initializes a global center function called the center command queue that allows you to schedule commands to be run once the script has loaded.

  3. Adds a command to create a new property specified via the ‘YOUR_PID_GOES_HERE’ parameter. Optionally sets any global flags on the script.

  4. Adds another command to send a view to Center for the current page.