Hi,
I installed this tag in my gtm for tracking page views and history changes in hubspot, tags are triggered when page changes but hubspot does not get any information in these cases, since the following code needs to be executed:
_hsq.push(['setPath', {{New History State}}]);
_hsq.push(['trackPageView']);
I solved it by creating a new custom html tag triggered by a change history with the following code:
<script type="text/javascript">
try{
if('pushState' === {{History Source}}){
_hsq.push(['setPath', {{New History State}}]);
_hsq.push(['trackPageView']);
}
}catch(error){
//what to do?
console.error(error);
}
</script>
do you think there is a possibility to insert this code into this plugin somehow? I think is a preety generic use case
Hi,
I installed this tag in my gtm for tracking page views and history changes in hubspot, tags are triggered when page changes but hubspot does not get any information in these cases, since the following code needs to be executed:
I solved it by creating a new custom html tag triggered by a change history with the following code:
<script type="text/javascript"> try{ if('pushState' === {{History Source}}){ _hsq.push(['setPath', {{New History State}}]); _hsq.push(['trackPageView']); } }catch(error){ //what to do? console.error(error); } </script>do you think there is a possibility to insert this code into this plugin somehow? I think is a preety generic use case