I need to get a user's email address into the DataLayer when they load the website, so that, depending on what they engage with, I can use the Hubl API to push them into the proper automation (and I am doing this because I could not find a way to directly add a person into automation with a command from the executed from the DataLayer). It feels like I am missing a piece of code in this, but I am not sure where.
<script>
dataLayer = [];
</script>
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/12345678.js"></script>
<!-- End of HubSpot Embed Code -->
<script>
var dataLayer = [{
email: "{{ contact.email }}",
hsgeo: "{{ contact.geographic_territory_hubspot_combined }}",
}]
</script>
<!-- Google Tag Manager -->
This page: https://sopheon.staging.wpengine.com/ looks like an external page and in this case, it looks like you're pulling contact email and geogrpahic details via the personalized token: {{ contact.email }} and {{ contact.geographic_territory_hubspot_combined }}. Currently, it is not possible to use personalized toke on external page and hence this is likely why you're not seeing the value populated on the page.
This page: https://sopheon.staging.wpengine.com/ looks like an external page and in this case, it looks like you're pulling contact email and geogrpahic details via the personalized token: {{ contact.email }} and {{ contact.geographic_territory_hubspot_combined }}. Currently, it is not possible to use personalized toke on external page and hence this is likely why you're not seeing the value populated on the page.