Squarespace Installation
To install Heap on Squarespace, complete the steps below:
- In the Home Menu of Squarespace click Settings, followed by Advanced, and then Code Injection.
- Select Header as your code injection field so Heap is injected to the tag on your site.
- Copy and paste the code snippet into the Header field and Save! Make sure you’ve updated the script to include your app ID.
<script type="text/javascript">
window.heapReadyCb=window.heapReadyCb||[],window.heap=window.heap||[],heap.load=function(e,t){window.heap.envId=e,window.heap.clientConfig=t=t||{},window.heap.clientConfig.shouldFetchServerConfig=!1;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://cdn.us.heap-api.com/config/"+e+"/heap_config.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(a,r);var n=["init","startTracking","stopTracking","track","resetIdentity","identify","getSessionId","getUserId","getIdentity","addUserProperties","addEventProperties","removeEventProperty","clearEventProperties","addAccountProperties","addAdapter","addTransformer","addTransformerFn","onReady","addPageviewProperties","removePageviewProperty","clearPageviewProperties","trackPageview"],i=function(e){return function(){var t=Array.prototype.slice.call(arguments,0);window.heapReadyCb.push({name:e,fn:function(){heap[e]&&heap[e].apply(heap,t)}})}};for(var p=0;p<n.length;p++)heap[n[p]]=i(n[p])};
heap.load("YOUR_APP_ID");
</script>
If you have not yet installed Heap, you’ll find your snippet on our install page. If using the snippet above, remember to replace
YOUR_APP_ID
with the ID of the environment to which you want to send data. You can find this ID on the Account > Manage > Projects page.
That’s it! You are ready to use Heap. For more information, check Squarespace’s article on using code injection.
Updated 3 months ago