Merge pull request #75 from xenu/master

added support for statcounter.com tracking code
This commit is contained in:
Tomasz Konojacki 2014-08-24 23:40:19 +02:00
commit f7b6693c02
2 changed files with 13 additions and 0 deletions

View File

@ -1526,6 +1526,11 @@
// Keep the Google Analytics cookies to one domain -- ga._setDomainName() // Keep the Google Analytics cookies to one domain -- ga._setDomainName()
// $config['google_analytics_domain'] = 'www.example.org'; // $config['google_analytics_domain'] = 'www.example.org';
// Link imageboard to your Statcounter.com account to track users and provide traffic insights without the Google botnet.
// Extract these values from Statcounter's JS tracking code:
// $config['statcounter_project'] = '1234567';
// $config['statcounter_security'] = 'acbd1234';
// If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can
// configure Tinyboard to PURGE files when they're written to. // configure Tinyboard to PURGE files when they're written to.
// $config['purge'] = array( // $config['purge'] = array(

View File

@ -305,3 +305,11 @@ onready(init);
var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %} var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %}
{% if config.statcounter_project and config.statcounter_security %}
var sc = document.createElement('script');
sc.type = 'text/javascript';
sc.innerHTML = 'var sc_project={{ config.statcounter_project }};var sc_invisible=1;var sc_security="{{ config.statcounter_security }}";var scJsHost=(("https:" == document.location.protocol) ? "https://secure." : "http://www.");document.write("<sc"+"ript type=text/javascript src="+scJsHost+"statcounter.com/counter/counter.js></"+"script>");';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(sc, s);
{% endif %}