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 %}

About the Author

Jacob Lett is the founder of Bootstrap Creative, a digital marketing consultancy that helps Michigan manufacturers generate qualified leads through HubSpot, technical SEO, and Google Ads. With over a decade of hands-on experience, he acts as a direct partner for B2B companies seeking measurable ROI from their marketing investment.



Related posts

Tags: ,

| Read My Editorial Policy

Want to Get Email Updates of New Articles?

Join My Email Newsletter