Frequently Asked Questions

Installation Guides

How do I integrate the HTML code on my website?

In order that trendcounter is able to collect and process data, you only need to integrate a small HTML code into your website. This HTML code uses several asynchronous technologies that will ensure that the performance of your website is not affected.

<script data-tc-id="your-project-key">

var _tcq = _tcq || [];
_tcq.push(['init', 'your-project-key']); 

(function(d, s) {
    var e = d.createElement(s); e.type = 'text/javascript';e.async = true;
    e.src = '//';
    var f = d.getElementsByTagName(s)[0]; f.parentNode.insertBefore(e, f);
})(document, 'script');


Hint: Each website receives a personalized HTML code, which you can get when you log in.

My site is accessible with and without www. What do I have to consider?

By default trendcounter removes a leading www of the domain name. This leads to clearer results and improves the accuracy of the analysis. If you do not wish that domains with and without www are merged, you can disable this behavior.

_tcq.push(['www', 'leave']); // do not remove leading www in domains (standard)
_tcq.push(['www', 'strip']); // remove leading www in domains

How can I adjust the current URL?

For the analysis to be as exactly as possible you should ensure that every page is only accessible via one unique URL. Otherwise, each active page would emerge under different URLs in the analysis. For this you have several options available.

_tcq.push(['url', 'full']);      // use the full URL with parameters (standard)
_tcq.push(['url', 'strip']);     // keep only the path and remove all parameters
_tcq.push(['url', 'canonical']); // use the canonical tag of the current page

How can I set an own Cookie Domain?

Should it be necessary, you can also set your own domain the analysis cookies are set on.

_tcq.push(['cookie_domain', 'your.domain.tld']);

How can I prevent trendcounter to set cookies?

If you are concerned with the use of cookies, you can disable them easily. But then some stats are no longer recorded. You can for example not identify any recurring visitors.

Hint: We are using so-called "First-Party"-Cookies, that are giving an increased privacy protection, because they are not available across different domains.

_tcq.push(['use_cookies', true]);    // use cookies (standard)
_tcq.push(['use_cookies', false]);   // dont't use cookies

How can I disable the automatic tracking?

By default, the analysis starts automatically after the 'init' call. Should your application require a separate start of the analysis (for example, AJAX pages), you can disable this feature. You can then start the analysis with a 'track'.

_tcq.push(['init', 'your-project-key', false]);  // disabled auto tracking
_tcq.push(['track']);                      // can be called whenever you need it

How can I set own URLs or Titles?

Dynamic applications sometimes require that URL and Title must be specified.

_tcq.push(['init', 'your-project-key', false]);
_tcq.push(['track', 'Custom URL', 'Custom Title']);

How do I track campaigns?

If you link your campaigns with the industry standard "utm_campaign", they are already tracked automatically by us.

 * Example usage
 * https://www.domain.tld/?utm_campaign=your-campaign-name&utm_source=newsletter...