Skip to main content

TG site tag

TrafficGuard Support avatar
Written by TrafficGuard Support
Updated over a week ago

You can track, measure and validate page views and events on your website in real-time via the client-side TG site tag.

Overview

The TG site tag allows you to send data to TrafficGuard from your website. This data, by default, includes, user behaviour and session information but the tag can also be configured to send custom events and data to TrafficGuard.

Installing the tag

To install the tag, copy the code from your property settings and paste it inside the <head> tag on every page of your site. Preferably as high in the <head> of the page as possible.
​

Alternate installation methods

The TG site tag can also be installed via various third party platforms:

TG site tag template

<!-- TrafficGuard Start -->
<script>
var dataTrafficGuard = dataTrafficGuard || [];
dataTrafficGuard.push(['property', '{property-id}']);
dataTrafficGuard.push(['event','pageview']);
(function() {
var tg = document.createElement('script'); tg.type = 'text/javascript'; tg.async = true;tg.src = '//tgtag.io/tg.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tg, s);
})();
</script>
<noscript><img src="//p.tgtag.io/event?property_id={property-id}&event_name=pageview&no_script=1" width="1" height="1" border="0"/></noscript>
<!-- TrafficGuard End-->

πŸ’‘ Tip
For more information about the TG site tag, check out:

Get Started

Measure

Advanced

Related


Did this answer your question?