Adding HTML code

Bronze Contributor
Bronze Contributor

Hello,

Is there a way to add this HTML code as an extension to TIQ?

<script>
window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
  originalLocation: document.location.protocol + '//' +
                    document.location.hostname +
                    document.location.pathname +
                    document.location.search
});
</script>

I have this set up in GTM with tag firing priority of 100 - is there a way that I can also prioritise it in TIQ? It is to support our GA tag as we are running a SPA site and so need to push thr Original Location through this.

1 REPLY 1

Adding HTML code

Silver Contributor
Silver Contributor

Hi josel,

Yes, you can use either "Javascript Code" or "Advanced Javascript Code" Extensions to inject custom Javascript code into your page/s.

image.png

You can do it the following way:

image.png

Remember to NOT include "<script>" "</script>" tags in your Javacript code. So do it like in the example above.

Also, have a look at Extension Scope documentation,  to better understand the possibilities of when your Javacript code can run. 

Public