aristath
Supreme Deity
WPMU DEV Staff
Lifetime member
Support Hamster Likes (0)
A couple of days ago I got disappointed in the way MarketPress displays sales statistics. That's only natural 'cause it DOESN'T provide statistics. Just a sum of our orders in a text widget on our dashboard. So I created a feature request here http://wpmudev.uservoice.com/forums/148158-wpmu-dev-new-development-requests/suggestions/2988917-better-marketpress-statistics-similar-to-the-affi and another one in this community.
I decided though not to wait and start developing it myself. After all, I always believed that the best way to get something done the way you like it is to do it yourself. :)
The project is going pretty well and so far I've been posting my results in the feature request issue I created in this community: http://premium.wpmudev.org/forums/topic/better-marketpress-statistics-similar-to-the-affiliate-statistics Feel free to read through it if you want.
But let's face it, few people look at feature requests and most times when they do they ignore them. So I'm posting it as an issue, hoping to get some other opinions and improve this, make this really good!
I'm developing on github so you can see it here https://github.com/nerdzgr/MarketPress-Statistics or directly download it from this link: https://github.com/nerdzgr/MarketPress-Statistics/zipball/master
I'm attaching a screenshot of the progress so far and hoping to get some opinions, or even better if you're a PHP Guru help out! This is a nice addition to MarketPress and needs our loving!

Responses (17)
Support Hamster (joined March 2012) Likes (0)
After you install and enable this plugin, you'll see a new menu item in your admin area called "Sales Statistics".
Just click on that and you're good to go. :)
Please note that this plugin requires MarketPress (duh!).
Support Kangaroo (joined March 2011) Likes (0)
Greetings Aristath,
Thank you so much for this and it is great that you included that it need Market Press, and even though you have it is still almost certain that someone will miss it!
I shall indeed alert the lead developer of Market Press of this project and invite him in here for his input.
Thank you as always for your contributions to out community and your meticulous attention to detail has made many coding items here better.
Sincerely, Joe
Lead Developer (joined May 2009) Likes (0)
Very cool looking! Great work, not easy to query all that info from postmeta.
We've been planning to expand our built in stats to something like this soon, I might be talking to you offline about that.
Support Hamster (joined March 2012) Likes (0)
@Aaron I'd like that!
If you take a look at the code, some parts of it are pretty while others are really crude and ugly... it was about a day's work and it gets the job done but it's not flexible (yet) and it would sure be nice having that kind of reports (implemented better of course) in core!
Support Hamster (joined March 2012) Likes (0)
Today's addition is useful yet unusual:
Sales by product price, displayed as a scatter chart!
This way we'll always know what price ranges are the most famous in our store. :)
See attached screenshot of this chart.
Support Hamster (joined March 2012) Likes (1)Liked by: 
And another one... Revenue by product price.
Twice the stats = twice the pleasure. :)
Support Hamster (joined March 2012) Likes (0)
Any issues and/or requests can be posted on this post or even better on github's issue queue: https://github.com/nerdzgr/MarketPress-Statistics/issues
Member (joined June 2012) Likes (0)
Hi Arististics,
Amazed and impressed!
Don't understand anything of the 814 lines you wrote but I'm very practical and the result is functionality. Great!
Is it also possible to show the amount of products you are selling, Now you are counting the orders. And what the average amount of products is per order?
And the top of the top would be when you can import the data from the old wp-ecommerce plugin in the statistics so that my year is again complete.
Looking forward to the next version.
Ella
Support Hamster (joined March 2012) Likes (0)
@Ella I removed the daily stats for the current month and added monthly product sales count and averages. It seemed more reasonable and useful than what I had before!
Right now I've put them in a line chart, use it and if you think it would be better as a bar chart or something else, tell me. I don't own a store myself and I'm trying to gather opinions on usability and what the important things are for a store owner..
As for importing orders from wp-ecommerce I'm afraid I've never even installed it, never used it and I wouldn't even know where to begin!
P.S. I read your comment on the other post too, I'm currently trying to figure out how to do some of your requests. :)
Support Hamster (joined March 2012) Likes (0)
@Ella I tried adding sales by top-10 users too.
Unfortunately I don't have enough data on my test site to do a thorough test and see how it works, so if you want test it out and tell me how it all works out. :)
Don't worry, there is no danger for your site as all this does is read the database without writing anything.
P.S. I haven't forgotten your paging issue too, I just haven't had the time to deal with it properly.
Member (joined June 2012) Likes (0)
Hi @aristath,
I already installed the first version to see how it's working :)
Unfortunately I don't have the complete data of my sales from the last two years..
Then you will have a great overview. Just the month July 2012 (My Marketpress period)
I love the overview (thanks also for the amount of products)
The customer section is great!
When a customer is a returning one, I can decide to send him/her a e-mail with a coupon code for the next purchase. That why the overview for coupon codes will be very good to have.
What happens when a customer the first time bought with a credit card and without registration, then I only have his/her email address. The second time they registrated, suddenly have a paypal account and there is a lof of information like name country etc. Does the statistics count that as one customer?
Hope I explained that good enough.. but by every sale is always a email address.
The overview for product sales is in may and June are negative?
In the whole story products are for me the most important.
With that I can decide what to make, kind of promotion, package deals,
what material I have to buy etc etc.
What would be ideal is a bar overview of the amount products every month and when you click on it, that you can see from all products the sales.
On this moment I collect all data from Etsy, Cratsy, Ellad2.com, Paypal and with excel I produce something where I can work with.
I really appreciate your effort and your practical way of thinking!!
( I also try: http://premium.wpmudev.org/forums/topic/make-marketpress-better#post-246928)
Member (joined June 2012) Likes (0)
forgot my screenshot :)
Support Hamster (joined March 2012) Likes (0)
@Ella
It's a bit complicated, I'll try to explain it the way I understand it. @Aaron if I'm mistaken in my logic please correct me...
There is one element in a user that's unique and unmistakable: the user's email.
In MarketPress, orders are a custom post type (mp_order). When a user creates an order, MarketPress creates a new post with post_type = mp_order and the author of that post is the wordpress user ID of the user with that particular e-mail.
When a user changes and/or adds some more data to his account he will have the same user ID (as long as his/her email is the same) so MarketPress and the statistics will know it's the same user.
If however the e-mail used is different, then WordPress assumes it's a different user and assigns a different user ID. In that case, MarketPress and the statistics plugin will not understand it's the same user and they will be treated as 2 different entities.
Most people have 1 email address and use it everywhere so that won't be a problem.
No, I just thought it would be prettier if the curves were smooth instead of cusp and what appears as "negative values" is an unfortunate side-effect. I can see how this can be confusing, and will be fixed today.
I haven't figured out how to query for coupon codes yet so I don't know how this will be done but I'm working on it. :)
P.S.1: What browser are you using? I'm asking because on your screenshot some things are not displayed the way they were intended and I want to understand why.
P.S.2: I understand that you don't want to show your users stats because that would be giving away your clients emails and everything, but can you confirm that the users section on the bottom works correctly? If so I can move on to figuring out country and city stats.
Support Hamster (joined March 2012) Likes (0)
I noticed that when we have total and average stats on the same chart, we can't see the average stats because they are so low compared to the total stats that they appear to be zero.
So totals and averages are now displayed in different charts.
I'm also attaching a screenshot of the plugin's current status.
Member (joined June 2012) Likes (0)
Hi Aristath,
Sorry for the late respond.
First, the user overview is working great I checked it with my excel sheet.
I only miss the amount of money what customers are spending and how many product :) Do I become greedy?
1 sales with 5 products or 3 sales with one product. O prefer the first one :)
I saw that one customer with the same email address but two different names is counted as two customers. So, can I conclude then that MarkettPress is not only looking to the email address?
Ella.
Support Hamster (joined March 2012) Likes (1)Liked by: 
This plugin is now on wordpress.org so from now on you'll be able to get it there. :)
http://wordpress.org/extend/plugins/marketpress-statistics/
DEV Diva (joined February 2012) Likes (0)
Hi @aristath
Nicely done! I already said this, but you create an awesome plugin. Wishing you all the best!
Gina
Become a member