Looses the UTM tags (the query string)

Looses the UTM tags (the query string)

matt4522nwtmatt4522nwt Posts: 3Questions: 1Answers: 0
edited September 11 in Free community support

We have website pages that use Datatables and are also landing pages that use Google Analytics UTM tags. These pages loose the UTM tags making UTM tracking not possible. It appears the page reloads without the UTM tags (the query string). Is there a way to preserve the UTM tags (the query string)?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    DataTables doesn't do anything with a UTM tag, so I'm not sure what is happening on your page. Without a test case (which is required in the forum rules and also in the template text for a new post that you deleted) I'm afraid I can't offer any help.

    If you link to a page showing the issue I can hopefully have a look, but I'd be astonished if it had anything to do with DataTables.

    Allan

  • matt4522nwtmatt4522nwt Posts: 3Questions: 1Answers: 0

    Allen,

    Thank you for the reply.

    This page contains a Datatables search at page bottom and will lose any query string I include. Here I include a test query-string. At first the URL with query string shows in the browser’s URL, but as the page loads the query string disappears.
    https://www.acsindustrial.com/encoder-repair/allen-bradley.html?tag=test

    This is a similar page that does not include a Datatables search at page bottom, and the query string survives.
    https://www.acsindustrial.com/encoder-repair/veeder-root.html?tag=test

    This problem only happens on pages that are using a Datatables search.

    Matt

  • kthorngrenkthorngren Posts: 21,450Questions: 26Answers: 4,975
    Answer ✓

    Looks like the problem is with this statement on line 748:

    window.history.pushState('page2', 'Title', currentLocation_onload);
    

    I placed a breakpoint there and before executing the statement the tag exists:

    After the statement and before initializing Datatables the tag is removed:

    It doesn't look like you have that statement in the second test case.

    Kevin

  • matt4522nwtmatt4522nwt Posts: 3Questions: 1Answers: 0

    Kevin,

    Thank you for the analysis. I see that the problem page has the addition JS that you pointed out. I will look into this.

    Thanks again!
    Matt

Sign In or Register to comment.