Giter Club home page Giter Club logo

piwik-for-magento's People

Contributors

adriansonline avatar adrianspeyer avatar dimasdwika avatar florinel-chis avatar sprankhub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

piwik-for-magento's Issues

Latest release tag is not stable

For not latest tag is looking to 5ff5823 commit, but this commit isn't include changes from 9723e8b and as result - release broken. Could you add new release tag or remove current tag and create new tag on fixed version? (or create tag v1.1.6.1)

E commerce tracking not working

Hi we had installed this extension mid December and everything was fine. Then on the 28th Ecommerce tracking stopped. Instead of conversion we have an increase in abandoned carts. Every time we try to add a product to cart it records as abandoned. Any help would be appreciated.

Thank you

Revenue is not tracking for new piwik version

Hi Sir,

I have installed the extension in magento and it was working perfectly for piwik version 1.10.1.

But when I upgraded piwik it stopped working.

Do you have any idea why this happened. What should I need to do to make it working in newer version of piwik.

JS errors on product page, checkout

When product name has apostrophe (symbol ' ) we have JS errors on product page, checkout page. As result customer may have some issues with checkout.

Requests sent as http even as config says https

Hi,

I noticed that website sends requests to analytics server in plain http. Even if "Install path" configured with https.

It still works ok since piwik redirects it to https, but I'd like to find why http. Any idea what may cause it?

Thanks,
Roman

Product page: Only parent category is passed, not special category

In Magento a product can be within several categories.

e.g. very often a product belongs to special category but also to the parents category.
e.g. the "blue shirt with funny print" belongs to "blue t-shirts" and to "all t-shirts"

would be good to pass both categories to piwik.

Piwik supports up to 5 categories:

// all parameters are optional, but we recommend to set at minimum productSKU and productName
_paq.push(['setEcommerceView',
"9780786706211", // (required) SKU: Product unique identifier
"Endurance: Shackleton's Incredible Voyage", // (optional) Product name
"Adventure Books", // (optional) Product category, or array of up to 5 categories
20.11 // (optional) Product Price as displayed on the page
]);
_paq.push(['trackPageView']);
[...]

source:
https://piwik.org/docs/ecommerce-analytics/

Category page: Only parent category is passed, not special category

same as
for special category pages
=> pass parent category + special category

// on a category page, productSKU and productName are not applicable and are set to false
_paq.push(['setEcommerceView',
productSku = false, // No product on Category page
productName = false, // No product on Category page
category = "Adventure Books" // Category Page, or array of up to 5 categories
]);
_paq.push(['trackPageView']);
[...]

source:
https://piwik.org/docs/ecommerce-analytics/

Manually tracked goals not working with extension

I've some manual tracked goals on my shop, called via

_paq.push(['trackGoal', 1]);

... this works fine, as long as I integrate PIWIK with the standart code in the footer, but not, when it's done via the extension. I tried to track it down, but with the extension activated the PIWIK ajax callback doesn't go to piwik.php, but to the current shop-url with a bunch of GET-parameters. That's where I gave up and hope someone more into the architecture of this extension can give me a hint.

Hi, this extension does not work with Magento 1.8.0.0

I installed a magento 1.8.0.0, but this extension does not work, it can get the customer's browsing history, but not the customer orders, this extension can not get the Ecommerce Analytics recorded, seems magento 1.8.0.0 changed the checkout code

Can you fix it?

Notice when product has no categories

In _getEcommerceCartUpdate we have next code:

        $cart = Mage::getModel('checkout/cart')->getQuote()->getAllVisibleItems();

        foreach ($cart as $cartItem) {

            //get category name
            $productId = $cartItem->product_id;
            $product = Mage::getModel('catalog/product')->load($productId);
            $cats = $product->getCategoryIds();
            if (isset($cats)) {
                $categoryId = $cats[0];
            } // just grab the first id
            $category = Mage::getModel('catalog/category')->load($categoryId);
            $categoryName = $category->getName();
            $productName = $cartItem->getName();
            $productName = str_replace('"', "", $productName);

            if ($cartItem->getPrice() == 0 || $cartItem->getPrice() < 0.00001):
                continue;
            endif;

            echo "_paq.push(['addEcommerceItem', '" . $cartItem->getSku() . "', " . json_encode($productName) . ", " . json_encode($categoryName) . ", " . $cartItem->getPrice() . ", " . $cartItem->getQty() . "]);";
            echo "\n";
        }

When product has no one categories we should have notice like this:

Notice: Undefined offset: 0  in /path_to_magento/app/code/community/PiwikMage/PiwikAnalytics/Block/Piwik.php on line 106

I think we should replace this part with

            $cats = $product->getCategoryIds();
            $categoryId = null;
            if (is_array($cats) && sizeof($cats)) {
                $categoryId = $cats[0];
            } // just grab the first id

Also load product and models is not good idea. Can we replace it with loading from product collection and category collection?

check and optimize for php 7.0 usage

Since PHP 7.0 is released and seems to achieve very good speed enhancements
see http://talks.php.net/froscon15#/magentobench
( use links at bottom for details )

and with this Magento 1.9.2.2 can be made easily compatible by using this extension
https://github.com/Inchoo/Inchoo_PHP7 [^]
which includes fixes for all known incompatibilities
see https://magento.stackexchange.com/questions/74008/is-magento-ready-for-php-7/

=> it would be great to check and ensure php 7 compatibility of this extension too.
To spread a word about the status of compatibility in documentation would make it perfect :-)

Outdated tracking code

Hi guys!

I'm working on a Chat plugin for Piwik : https://github.com/VincentLahaye/piwik-chat

And it appears that the tracking code that your module includes (and that i'm using on my own e-commerce website) is kind of outdated. The very important "_paq.push(['setSiteId', 1]);" instruction is not present on your code.

It effects directly the method Piwik.getAsyncTracker().getRequest(), which will return a request path with an empty idSite variable. And, eventually, the chat popup will not show.

Maybe you should update this part with the new piwk's tracking code ?

Cheers!
Vincent.

Only white site

I get only a white site in magento admin, instead of the iframe (magento 1.9.1 , iframe is active). I use the latest Piwik version.

THX for help

Search results page layout changed upon refresh

I submitted a case to Magento Enterprise support about an issue we're experiencing with the layout of the search results page breaking across the site. Their engineer narrowed it down to the "PiwikMage_PiwikAnalytics extension" and told me to reach out to you.

The crux of the issue is that portions of the header are moved to the main content section of the page whenever any site visitor refreshes the search results page or copies and pastes the search result page's URL. This appears to somehow corrupt the "Blocks HTML output" Magento cache, based on the fact that the only way to restore the proper page layout is to refresh this cache.

Update:
Magento Enterprise support deduced that this plugin caused the issue by process of elimination by disabling all plugins and re-enabling them one at a time.

Page layout before a refresh:
screenshot1

Page layout after a refresh:
screenshot2

Only get current store categories

Bonjour,

The _getProductPageview() function uses the first category from $product->getCategoryIds(). In a multi stores context, if this category is only visible on another store, it returns null and seems to block the tracker.
I added a filter with the help of http://stackoverflow.com/questions/15505221/how-do-i-get-the-category-ids-that-a-product-is-in-with-respect-to-the-store-tha .
Original

$categoryName = '';
$categoryIds = $product->getCategoryIds();

Modified :

$categoryName = '';
// Get categories visible on store only
$sameStoreCategories = Mage::getResourceModel('catalog/category_flat_collection')
    ->addIdFilter($product->getCategoryIds())
    ->getItems();
$categoryIds = array_keys($sameStoreCategories);

ECommerce not working

Hi Team,

I have installed the piwik on my local system. Also, I have install piwik magento extension in local magento site It is working for visitor chart but I have placed one order in magento but it was not reflect in piwik. Also, Images were not load in magento piwik report so how to resolved that please help me it's urgent.

Regards,
Ankit Modi

Syntax error and no character escaping in titles.

On https://github.com/adriansonline/Piwik-for-Magento/blob/master/app/code/community/PiwikMage/PiwikAnalytics/Block/Piwik.php in line 169 there is a syntax error (single quote after false) which renders the current version pretty much useless (no category and checkout tracking due to the error). Or am I missing something here? (Just wondering how such a typo could pass any test run...)

Also special characters in product titles are not escaped in any way. So if you have one product with a special character (i.e. single quotes) in your cart the whole cart will not get tracked as the piwik integration breaks.

Sry for not creating a pull request. Anyways thanks for the plugin and best regards.

Piwik subtotal with getGrandTotal or getBaseGrandTotal ?

Here: src/app/code/community/PiwikMage/PiwikAnalytics/Block/Piwik.php on line 75 we have $order->getGrandTotal() but i think we need $order->getBaseGrandTotal() or?

You do that for "$result" some lines below. Also think about getBaseShippingAmount & getBaseShippingTaxAmount in line 75.

One of our customers have large subtotals because he has a lot of different currencies.

Option to choose Piwik tracking method

I would like to have the option to track visits by using Piwik Tracking API (PiwikTracker.php) instead by public java script. Please see http://piwik.org/docs/tracking-api/ section "Piwik Tracking API (Advanced users)" and download PiwikTracker.php from http://demo.piwik.org/index.php?module=SitesManager&action=downloadPiwikTracker&idSite={$IDSITE}&piwikUrl=http://piwik.example.org/

The API is easy to use and I have created a simple class in another project to use the API:

<?php

require_once(__DIR__ . '/piwik/PiwikTracker.php');

/**
 * Static class that creates and appends a server access logfile.
 */
class PiwikLogger
{

    private $authToken;
    private $siteId;
    private $myDomain;

    /**
     * @param string $piwikURL URL to Piwik.
     * @param int $siteId The ID of the site to track.
     * @param string $authToken The admin authentication token. Get it from your Piwik.
     * @param string $myDomain The domain of your site.
     */
    public function __construct($piwikURL, $siteId, $authToken, $myDomain)
    {
        $this->siteId = $siteId;
        $this->authToken = $authToken;
        $this->myDomain = $myDomain;

        // init piwik URL
        PiwikTracker::$URL = $piwikURL;
    }

    /**
     * Create a valid log string.
     *
     * @param string $data The string that should be made valid.
     * @param bool $checkDash If true and $data is empty a - will be returned.
     *
     * @return string A valid string.
     */
    private function validString($data, $checkDash)
    {
        if ($checkDash && $data == "")
            return "-";

        // remove some special invalid chars
        $data = str_replace(array("\n", "\r", "\""), "+", $data);

        return $data;
    }

    /**
     * Writes an entry to Piwik.
     *
     * @param string $pageTitle Optional. Title of the web page.
     * @param int $httpStatus Optional. One of the HTTP status code, the default is 200.
     */
    public function logAccess($pageTitle = '', $httpStatus = 200)
    {
        // do logging only if site id and domain is specified
        if ($this->siteId == null || $this->myDomain == null)
            return;

        if ($pageTitle === '')
            $pageTitle = 'Unknown Page';

        // write log to piwik
        $t = new PiwikTracker($this->siteId);

        // Optional tracking
        if (isset($_SERVER['HTTP_USER_AGENT']))
            $t->setUserAgent(self::validString($_SERVER['HTTP_USER_AGENT'], false));
        if (isset($_SERVER['HTTP_REFERER']))
            $t->setUrlReferrer(self::validString($_SERVER['HTTP_REFERER'], false));
        //$t->setBrowserLanguage('de');
        //$t->setLocalTime( '12:34:06' );
        //$t->setResolution( 1024, 768 );
        //$t->setBrowserHasCookies(true);
        //$t->setCustomVariable(2, 'httpStatus', $httpStatus);
        //$t->setPlugins($flash = true, $java = true, $director = false);
        $t->setTokenAuth($this->authToken);
        $t->setIp(self::validString($_SERVER['REMOTE_ADDR'], false));
        $t->setForceVisitDateTime('now');

        // TODO: $_SERVER['SERVER_PROTOCOL'] gibt immer nur http und niemals https zurück
        // page not found
        if ($httpStatus == 404)
            $t->setUrl(self::validString('http://' . $this->myDomain . '/404' . $_SERVER['REQUEST_URI'], false));
        else
            $t->setUrl(self::validString('http://' . $this->myDomain . $_SERVER['REQUEST_URI'], false));

        $t->doTrackPageView($pageTitle);
    }

}

This class is used like (example for WordPress)

<?php
$piwikLogger = new PiwikLogger(
            get_option('PiwikLogging.PiwikURL'),
            get_option('PiwikLogging.SiteId'),
            get_option('PiwikLogging.AuthToken'),
            get_option('PiwikLogging.MyDomain'));

        $piwikLogger->logAccess(get_the_title(), is_404() ? 404 : 200);

Is there any hope that you could implement such feature and let the user choose the tracking method in the Magento configuration? Maybe, I can help you to implement this feature, but a have nearly no experience according to the Magento framework/API. Thank you!

Missing orders from analytics

I have around 300 orders per day on my store, but piwik-commerce barely register half of them.
We've even tried disabling the do-not-track-me feature. Anything to do to increase the tracking rate of orders?

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.