Skip to content

Page history change trigger not working #2

@danibuiza

Description

@danibuiza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions