Reply
Highlighted
Frequent Visitor
Posts: 17
Registered: ‎11-10-2017
Accepted Solution

How to add a random number to a pixel

I received a pixel request from a vendor whcih includes a script to add a random number into a query string on the URL.See the requested code snippet below. How can I best implement this in Tealium?

<!-- JavaScript based. Auto SSL. Auto fallback to image -->
<!-- Start FastG8 Pixel Tag -->
<script type="text/javascript">
(function() {
var elem = document.createElement('script');
elem.src=(document.location.protocol == "https:" ? "https://" : "http://") + "u.fg8dgt.com/pixel?type=js&id=485&cb=" + Math.floor(Math.random() * 100000000);
elem.async = true;
elem.type = "text/javascript";
var scpt = document.getElementsByTagName('script')[0];
scpt.parentNode.insertBefore(elem, scpt);
})();
</script>
<noscript>
<img src="//u.fg8dgt.com/pixel?type=img&id=485&cb=[CACHE_BUSTER]" style="display: none;" border="0" height="1" width="1"/>
</noscript>
<!-- End FastG8 Pixel Tag -->

 

Reply
0 Kudos
Tealium Employee
Posts: 14
Registered: ‎03-27-2017

Re: How to add a random number to a pixel

Hi Krasner,

I would recommend using the Tealium Generic Tag. Documentation -> https://community.tealiumiq.com/t5/Tags/Tealium-Generic-Tag-Setup-Guide/ta-p/12034
Includes info about adding cache busting.

If you have any further questions regarding setting this up after reviewing the documentation please let us know. 

Cheers,
Michael

Frequent Visitor
Posts: 17
Registered: ‎11-10-2017

Re: How to add a random number to a pixel

Thank you. I hadn't used the cache busting option, but I see that quite a number of my tag requests from vendors include similar random number generating scripts whcih all are essentially just "cache busting". The tealium generic tag with the cache busting option enabled and configured serves the need nicely. Thanks!

Reply
0 Kudos