How to Load Script on One Domain and Exclude Previews in HubSpot [HubL Snippet]


How to Load Script on One Domain and Exclude Previews in HubSpot [HubL Snippet]

The HubL code below will help you scope heatmap or anlytics tracking on one domain and exclude any previews.


{% if request.domain == 'www.yourdomain.com' and request.query is not string_containing 'hs_preview' %}

{% endif %}

Written by: Jake Lett
Jake Lett is a results-driven B2B marketing consultant with 15+ years of experience helping businesses boost online visibility, generate qualified leads, and increase sales. Specializing in SEO, HubSpot, and PPC campaign management, Jake leverages proven strategies to deliver measurable growth. As a Certified Google Ads Specialist and HubSpot Developer, he is committed to driving impactful results for his clients.

Related posts

Tags: ,

Want to Get Email Updates of New Articles?

Join My Email Newsletter