Every product shows up with x2 in visitor log

Hi,
I am using woo-commerce in wordpress. When I look at my visitor log, every product they view has 2x in front of the line. Something that indicates every product they visit is refreshed.

I installed Piwik using the “WooCommerce Piwik integration”. Any chance I am writing double to the database, and i case - how to stop/fix?

Attached is a screenshot of the error.

See pictures:
http://www.altikost.no/wp-content/uploads/2016/04/Screen-Shot-2016-04-19-at-21.39.58.png

http://www.altikost.no/wp-content/uploads/2016/04/Screen-Shot-2016-04-19-at-21.40.34.png

Seems like a “mistake” in the tracking code. Did you have a look at the inserted tracking code in the website? Maybe _paq.push(['trackPageView']); is called twice or something like that.

This is from the class-wc-piwik.php file:

function category_view()
{
global $wp_query;

    if (isset($wp_query->query_vars['product_cat']) && !empty($wp_query->query_vars['product_cat'])) {
        $jsCode = sprintf("
        _paq.push(['setEcommerceView',
                false,
                false,
                '%s'
        ]);
        _paq.push(['trackPageView']);
        ", urlencode($wp_query->queried_object->name));
        wc_enqueue_js($jsCode);
    }
}

function product_view()
{
    global $product;

    $jsCode = sprintf("
        _paq.push(['setEcommerceView',
                '%s',
                '%s',
                %s,
                %f
        ]);
        _paq.push(['trackPageView']);
    ",
        $product->get_sku(),
        urlencode($product->get_title()),
        $this->getEncodedCategoriesByProduct($product),
        $product->get_price()
    );
    wc_enqueue_js($jsCode);
}

Not really sure this helps… Seems like only one call for the tracking code…

well - I have found the following in the “/plugins/woocommerce-piwik-integration/includes” file:

function category_view()
{
global $wp_query;

    if (isset($wp_query->query_vars['product_cat']) && !empty($wp_query->query_vars['product_cat'])) {
        $jsCode = sprintf("
        _paq.push(['setEcommerceView',
                false,
                false,
                '%s'
        ]);
        _paq.push(['trackPageView']);
        ", urlencode($wp_query->queried_object->name));
        wc_enqueue_js($jsCode);
    }
}

function product_view()
{
    global $product;

    $jsCode = sprintf("
        _paq.push(['setEcommerceView',
                '%s',
                '%s',
                %s,
                %f
        ]);
        _paq.push(['trackPageView']);
    ",
        $product->get_sku(),
        urlencode($product->get_title()),
        $this->getEncodedCategoriesByProduct($product),
        $product->get_price()
    );
    wc_enqueue_js($jsCode);
}

I have also found this code in the “/plugins/woocommerce-piwik-integration/timplates” file:

var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
	var u = (("https:" == document.location.protocol) ? "https" : "http") + "://<?php echo esc_js($this->piwik_domain_name); ?>/";
	_paq.push(["setTrackerUrl", u + "piwik.php"]);
	_paq.push(["setSiteId", <?php echo esc_js($this->piwik_idsite); ?>]);
	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);
})();

Does this help for finding the fault?