adrianspeyer / piwik-for-magento Goto Github PK
View Code? Open in Web Editor NEWThis is an extension which allows you to get Ecommerce Magento data into your Piwik
This is an extension which allows you to get Ecommerce Magento data into your Piwik
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
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.
Does this extension support Piwik 2.8?
Can we upgrade it?
When product name has apostrophe (symbol ' ) we have JS errors on product page, checkout page. As result customer may have some issues with checkout.
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
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']);
[...]
Fix the typo in the repo description: Magneto - Magento
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']);
[...]
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.
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?
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?
Hi,
i had to remove your extension from packages.firegento.com because
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/adriansonline/Piwik-for-Magento" file could not be downloaded (HTTP/1.1 404 Not Found)
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 :-)
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.
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
Are you planning to port the extension to Magento 2.x version?
Hi your Magento Plugin http://www.magentocommerce.com/magento-connect/piwik-ecommerce.html don't work for the new Magento 1.9. Do you plan to update it ?
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.
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);
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
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.
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.
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!
Would be great have ability to install this module via composer.
More info:
https://github.com/magento-hackathon/magento-composer-installer
https://github.com/magento-hackathon/magento-composer-installer/blob/master/doc/MakeAModuleInstallableWithComposer.md
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.