GithubHelp home page GithubHelp logo

Comments (7)

mnapoli avatar mnapoli commented on September 28, 2024

So there is just this part that is added to the normal tracker right:

_paq.push(["setCustomVariable", 1, "error404", "1", "page"]);

from developer-documentation.

mnapoli avatar mnapoli commented on September 28, 2024

See 8398982

from developer-documentation.

mattab avatar mattab commented on September 28, 2024

@mnapoli the call to _paq.push(["setCustomVariable", 1, "error404", "1", "page"]);
should appear just before trackPageView because setCustomVariable decorates the request and track* functions send the request.

from developer-documentation.

mnapoli avatar mnapoli commented on September 28, 2024

My bad, I fixed this, here is the tracking code that is online now:

<!-- Piwik -->
<script type="text/javascript">

    var _paq = _paq || [];
    _paq.push(["setCookieDomain", "*.piwik.org"]);
    _paq.push(["setCustomVariable", 1, "error404", "1", "page"]);
    _paq.push(["trackPageView"]);
    _paq.push(["enableLinkTracking"]);

    function track() {

        (function() {
            var u=(("https:" == document.location.protocol) ? "https" : "http") + "://demo.piwik.org/";
            _paq.push(["setTrackerUrl", u+"piwik.php"]);
            _paq.push(["setSiteId", "36"]);
            var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
            g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
        })();
    }

    if (window.addEventListener) { window.addEventListener("load", track, false); }
    else if (window.attachEvent) { window.attachEvent("onload",track); }
    else {
        track();
    }
</script>
<!-- End Piwik Code -->

from developer-documentation.

mattab avatar mattab commented on September 28, 2024

👍

from developer-documentation.

mpdude avatar mpdude commented on September 28, 2024

I noticed that this uses a custom variable to track the error, whereas http://piwik.org/faq/how-to/faq_60/ recommends tweaking the page title to contain the error message and referrer.

Which way is better (why?) and should one of both be fixed?

from developer-documentation.

mattab avatar mattab commented on September 28, 2024

@mpdude it's legitimate request. do you mind opening an issue on piwik/piwik and we'll discuss there

from developer-documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.