Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 13117

strange: piwik sometimes track, sometimes tracks not goals(td)

$
0
0
i have an stupid problem in virtuemart 2 (joomla online-shop component) - my goals are not tracked reliable. ~40 percent orders are definitely not tracked as goals .
In my old piwik-version (must have been next to last) I tried JS tracking by page-title and part of uri on confirmation page. this page refers to paypal after 2 seconds. So i thought: "ok, perhaps this is the problem: 2 seconds is not enough to track reliable. I simply track goals one page before, onSubmit.
Today in the morning i updated piwik to Piwik 1.11.1 and put following code in the page:

jQuery(document).ready(function($) {
$('span#buyButton a').attr('href', '#');
$('span#buyButton a').click(function(event) {
event.preventDefault();
logGoal(8.7);
$('#checkoutForm').submit();
});

...and before </body>:
<script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
      _paq.push(["setCookieDomain", "*.myurl.de"]);
      _paq.push(["trackPageView"]);
      _paq.push(["enableLinkTracking"]);

      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.myurl.de/piwik/";
        _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.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
      })();
    </script>
<script type="text/javascript">
        function logGoal(revenue){
            try {
                _paq.push(['trackGoal', 1, revenue]);
            }
            catch( err ) {}
        }
    </script>
<noscript>&lt;p&gt;&lt;img src="https://www.myurl.de/piwik/piwik.php?idsite=1" style="border:0" alt="" /&gt;&lt;/p&gt;</noscript>
I changed the goal to manual triggering an then quick-tested: my visit and the goal was tracked correctly.
But now in the evening i looked again: for the one order today there was no goal tracked! I really ask myself why, the button has to be klicked for everey order. nothing special in the order: the whole visit was tracked correctly.
I hope s.o. has a tip what i could test next.

Bye, Mojo

Viewing all articles
Browse latest Browse all 13117

Trending Articles