Browse Source

Added prefix for dev systems to tracking

master
Teknikode 6 years ago
parent
commit
6f43037f72
  1. 40
      Teknik/Views/Shared/_Layout.cshtml

40
Teknik/Views/Shared/_Layout.cshtml

@ -54,23 +54,29 @@ @@ -54,23 +54,29 @@
@if (Model.Config.PiwikConfig.Enabled)
{
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.teknik.io"]);
_paq.push(["setDomains", ["*.teknik.io"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.teknik.io/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
string sub = Request.RequestContext.RouteData.Values["sub"].ToString();
if (Model.Config.DevEnvironment)
{
sub = "dev - " + sub;
}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", "@sub/" + document.title]);
_paq.push(["setCookieDomain", "*.teknik.io"]);
_paq.push(["setDomains", ["*.teknik.io"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.teknik.io/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
}
<script type="text/javascript">

Loading…
Cancel
Save