Why Flipkart Affiliate Program Cannot be trusted, and why I will never use it again.

Flipkart-Affiliate-Program-with-it-

Update: June 7th 2014 1600 IST.
Yesterday night at around 11PM Mr Manmeet Singh (Channel lead, Affiliate Program) called me and tried to explain there is no fraud and they are not trying to fleece the affiliates. And in between mentioned that it is a common occurrence and they cancel thousands of order everyday. The reports and cancelation details he sent me seemed genuine.This can not happen as I mentioned below why this can rarely happen. This got me thinking I looked deep into the issue andturns out it is not a case of fraud but, a case of carelessness and sloppy code from their developers. According to their terms, affiliate cookie should be unset when the first sale is made from our link. But they don’t unset it when the sale is made.

So when Moto E was launched, orders were being cancelled automatically for lot of users and every time there tried to order it again, it was counted as a new sale and  credited to our account.

It is not acceptable for a company with this high reputation and size to produce sloppy code like this. This is only one case we found, there could be several such bugs resulting from their sloppy code. A friend of mine uncovered another issue, I can not make it public at this time but will update the post when the time comes.

When there are lot of attacks happening on high profile sites like linked in, ebay, and the vulnerabilities that are discovered everyday, there is no place for sloppy code like this, definitely not on huge sites like flipkart. I might even reconsider shopping on flipkart leave alone being an affiliate. This might seem like I’m blowing this out of proportion, but wait till my friends findings are made public.

They sent me an excel sheet with details about the cancelled orders, and I asked for some further information and offered to remove the post if they bring transparency.

new-0

Their response

new

Things to note here

  • First two users COD verification failed, only they should explain why the orders were credited to my account when verification failed.
  • No issues with the third.
  • The last user is an old friend, we prepared for JEE together in 2004 and haven’t been in touch all these days. I talked to him about it today and he told me that his orders were cancelled every time he tried to order one, so he ended ordering 10times, and was successfully able to order it the following day. A lead I sent them purchased the product even after their failure the first 10 times, yet I haven’t been credited for the sale.

If this is the level of commitment they have towards their affiliates, why should anyone use them?

Here is the proof of my findings. This is my first screencast with voice over, so thanks for bearing with my voice, and the ummmsss.

On 13th May I was casually scrolling to my Facebook feed on my mobile and suddenly a post caught my attention. It was about Moto E, which was being launched the following day exclusively by Flipkart. I thought it was good opportunity to test and play with Facebook ads. I quickly jumped of my bed to get on my Mac, and created an ad and posted in the pages I own and on my own time line.

I posted the ad before the launch as the cookie life time was 24 hours, and posting the ad 12 hours before would increase the reach of the ad by the time it really mattered.

Here are the promoted posts/ads

Flipkarts ad on TechBU's fan page, see the reach, shares, likes.

Flipkarts ad on TechBU‘s fan page, see the reach, shares, likes.

Same performance on TheGeekDaily fan page to.

Same performance on TheGeekDaily fan page to.

One more

One more

This one was quite popular, more than 15 people copied this status. With their own affiliate link ofcourse.

This one was quite popular, more than 15 people copied this status. With their own affiliate link ofcourse.

12 Sales I made on day 1As a result of these campaigns, I was able to sell couple of units with in hour of the launch. The final tally before I went to bed that day around 3AM was 12 units sold with a commission of rs 3359.52. This is little less than I spent on the ads, I did not care. I was just happy that my first paid affiliate campaign worked and did not fall flat like a dud.

Everything was good so far until this happened.
I woke up at around 9AM the following day, and the first thing I did was to check the flipkart affiliate earnings. Flipkart affiliates even made it to my bookmarks toolbar yesterday. I was expecting around 25 sales based on how the campaign was doing. I was shocked to see only 3 sales. I immediately mailed their affiliate support and here is how it went.

1

2

3

For this they said that the orders were cancelled by the orders management team. Thing to note here

Their order management team works at night, cool.

We affiliates spend, money, time, and our precious resources to send them leads, instead of doing everything in their power to convert that lead into a sale, they kill the leads.

4

5

For this they give me BS, standard answer which doesn’t, say, convey or prove anything.

6

From here on I was passed as a ball between their order management team and the affiliate team, they did not talk anything that would make sense until I threatened them saying I would write a blog post about the whole incident.

7

My email to their order management team.

8

And their order management team asks me to contact their affiliate team, f*** joke.

9

This is when I replied them strongly and threaded to write a blog post

10

This is when they started moving their @$$$

11

If they could not handle the demand why ask us to promote it at all. This not their first exclusive launch, they launched Moto G before this. They should have estimated the demand beforehand.

Then we wouldn’t have invested our time, money and effort in promoting it.

12

Flipkart asking Affiliates to promote Moto E

Flipkart asking Affiliates to promote Moto E

Then this new guy comes into picture, I have to explain him everything. Doesn’t seem to have a clue about the issue at hand or how their affiliate system works.

Ask’s me to provide the order ID’s, how they fuck am I going to get them? He keeps asking the same on the phone.

For those who don’t know, flipkarts affiliate reporting sucks. They do not give any useful data, its highly in their favour to alter reports rig data. Forget getting the order ID’s

13

14

15

This is where it gets interesting, and where they take affiliates for fools. Read on to find out what he says is pure BS.

16

Later, on discussion about this on phone he told me that the orders were made from 2 account. This is why what he said is BS, and why I decided to stop reasoning with them and write this blog post instead.

My last email to them.

My last email to them.

  • Initially they said that the orders were cancelled as they could not meet the demand. If what they were saying is true, they would have said that the orders were from the same account in the first email itself with out waiting my time.
  • Not just me, lot of people in Facebook friends list reported the same when I posted about this.
  • For what they are saying to be true there are two cases
    1. The product is bought in a single bulk order.
    2. The user bought the phone from my link, cleared his cache, then went back to flipkart and through my affiliate link and bought the product again.
    This did not happen just once or twice, but six times. To add cake on top of the cake, it wasn’t just one but two users who did this.

If one had happened, then the order wouldn’t have been reordered as only one sale according to their terms.

  1. If in a particular transaction, the customer buys 3 quantities of product ‘A’ and 2 quantities of product ‘B’ the total number of items is 2.

  2. If the same product ‘A’ is ordered by the customer in 2 different orders, number of items would be 2.

A single person ordering a product through my affiliate link even twice is highly unlikely, as according to their terms of services, and FAQ, my cookie will expire as soon as the user places the order.

Flipkart-Affiliate-TermsFor someone to buy a product even twice form my affiliate link all the planets and moons in our solar system should come in a straight line. Leave alone ordering 6, that to by two people.

I won’t say I love flipkart, but I don’t hate them either. I’m happy to see a Indian startup reach such heights.
But things like this shouldn’t happen, companies shouldn’t take affiliates for granted we help them build their business. A message has to be sent, they won’t get a free pass out of things like this.

If you have been scammed by Flipkart affiliate program, raise your voice, share your story in comments, share this article. Show them they can not get away with things like these.

PS: To be fair to them, I mailed them about the article and offered to publish their side of the story if they want to.

Like a boss !!

Other cases of Flipkart fraud

http://winappleworld.com/flipkart-fraud-pricing-stunned/

Please up vote on reddit
http://www.reddit.com/r/india/comments/27hy28/flipkart_affiliate_program_is_a_fraud/

error: command ‘cc’ failed with exit status 1; Can’t install PIL, Pillow, MySql and other packages in Mavericks.

If you are getting the following error when installing python packages using PIP or easy_install, don’t worry. You have come to the right place for solution.

First make sure you have developer tools installed. You can install them by executing the following command in terminal

xcode-select --install

The clang errors are due to changes introduced in Xcode 5.1 and due to the way the Apple-supplied system Python 2.7 is built. You can tell them to shut up by adding these environment variables in terminal.

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Error while installing PIL, Pillow, MySql on OSX Mavericks using PIP

**clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1**

A complete guide to install Meteor App Telescope on Your Own Server

In this tutorial I’m going to give you detailed instructions on how to deploy Telescope on your own server running Centos.

I’m doing this on a  virtual machine on my server, the same procedure applies to any server like Amazon EC2, Heroku or any dedicated server running centos.

At the end of this tutorial you will be running telescope on port 3000 with nginx as proxy.

List of things we will cover in this tutorial

  1. Install node.js
  2. Install mongodb
  3. Install meteor
  4. Install meteorite
  5. Install telescope
  6. Install nginx

Before we start, lets update the system and make sure we have all the development libraries. Run the following commands as root

yum update
yum groupinstall "Development Tools"

Installing node.js  and NPM on Centos

Run the following commands. Make takes time, you might wanna get some coffee :)


wget http://nodejs.org/dist/v0.10.23/node-v0.10.23.tar.gz
tar xvfz node-v0.10.23.tar.gz
cd node-v0.10.23
./configure
make
sudo make install

You don’t have to install NPM sperately, it’s bundled with the node.

If you get “virtual memory exhausted: Cannot allocate memory” error, try rebooting the system.

Note: You might be tempted to get the latest code from git and install it, but for some reason beyond my understanding at this time, it doesn’t work.
It throws some error related to fibers package.
Error: “pre” versions of node cannot be installed, use –nodedir flag instead

Install MongoDB

Create a /etc/yum.repos.d/mongodb.repo file to hold the following configuration information for the MongoDB repository:

If you are running a 64-bit system, use the following configuration:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

If you are running a 32-bit system, which is not recommended for production deployments, use the following configuration:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
gpgcheck=0
enabled=1

Issue the following command (as root or with sudo) to install the latest stable version of MongoDB and the associated tools:

yum install mongo-10gen mongo-10gen-server

Install meteor

Installing meteor is very simple, just run the following command

curl https://install.meteor.com | /bin/sh

install meteorite

npm install -g meteorite

ref: http://docs.meteor.com/

Install Telescope

git clone https://github.com/SachaG/Telescope.git
cd Telescope
mrt bundle ~/bundle.tgz

Last command bundles everything we need to run the app and saves it in your home directory.

Before we run the app, we have to reinstall fibers


cd ~/bundle/programs/server
rm -f -r node_modules/fibers
npm install fibers

Now lets start telescope

PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp_db ROOT_URL=http://myappurl.com/ node bundle/main.js

You can change the port to what ever you want, 80 if you do not want to use a proxy server.

ref: https://github.com/SachaG/Telescope

Using NGINX as proxy for Telescope Meteor app

open nginx configuration file, In Centos it’s located at /etc/nginx/nginx.conf

and add this to server section of the file and restart nginx /etc/init.d/nginx restart

location / {
	proxy_pass	http://localhost:3000;
	proxy_set_header	Connection "";
	proxy_set_header	Host	$host;
	proxy_set_header	X-Real-IP	$remote_addr;
	proxy_set_header	X-Forwarded-For $proxy_add_x_forwarded_for;
}

Having to start the Telescope app manually when ever the system reboots is not cool, lets add it to system startup. We will use upstart for this.

Create a file called my_app.conf at /etc/init/ and add the following content to it.

start on runlevel [2345]
stop on runlevel [06]
respawn
respawn limit 10 5
script	
    APP_DIR=/absolute/url/to/telescope/bundle
    LOG_FILE=/var/log/amyapp_log
    export PORT=3000
    export MONGO_URL=mongodb://localhost:27017/myapp_db
    export ROOT_URL=http://my_app_url/
    /usr/local/bin/node "$APP_DIR/main.js" 2>&1 >> $LOG_FILE
end script

Are all the required programs in startup list? Lets check if mongodb and nginx are in system startup, if not lets add them.

Check it with the following command

sudo /sbin/chkconfig --list

If they are not, add them with the following command

sudo /sbin/chkconfig mongod on
sudo /sbin/chkconfig nginx on

It’s not optimal to serve static files through node, I tried to serve them with nginx but wasn’t successful. I will update the post, once I find the answer.

You should install phantomjs to make your app crawlable/searchable.

Installing Phantomjs

wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
tar xvf phantomjs-1.9.2-linux-x86_64.tar.bz2
cp phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/bin

You can get the latest and relevant download links from phantomjs downloads page.
If you face any problems during phatomjs installation, try this tutorial

Though the entire process takes less than 10 minutes now ( excluding the compile time of node ), It took me more than 2 days to figure everything out. I hope this tutorial tutorial saves your time.

If you find all this complicated but want to build a site with telescope, I’m available for hire :). Shouth News is the first site I built with telescope

2 Common errors while setting up phpMyAdmin on Mac OSX

You might encounter the following two errors while installing phpMyAdmin on OSX

  • Login without password is forbidden by the configuration ( See AllowNoPassword )
  • #2002 can not login tot the MySQL server

Here are the fixes for the above two errors.

1. Open phpMyAdmin configuration located at (phpMyAdmin Folder)/config.inc.php and change

$cfg['Servers'][$i]['AllowNoPassword'] = False; to $cfg['Servers'][$i]['AllowNoPassword'] = true;

2. In the configuration file change  $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1';

Djnago | Set the defulat ordering rule for queries in the models

Though we can specify order explicitly in queries like below

Posts.objects.order_by('published')

it is repetitive and most of the times we will want to order by a particular field.

We can specify the order in the models like this

class Post(models.Model):
    title = models.CharField(max_length=140)
    content = models.TextField()
    published = models.DateTimeField()

    def __unicode__(self):
        return self.title

    class Meta:
        ordering = ['published']

Restrict Django Templates From Deleting Data.

Django allows method calls inside template system. Though this is an useful feature, some of the methods will have side effects. Mostly the ones that alter data.
Say, for instance, you have a UserAccount object that has a delete() method. If a template includes something like {{ account.delete }}, where account is a UserAccount object, the object would be deleted when the template is rendered!

To prevent this, set the function attribute alters_data on the method:

def delete(self):
# Delete the account
delete.alters_data = True

The template system won’t execute any method marked in this way. Continuing the above example, if a template includes {{ account.delete }} and the delete() method has the alters_data=True, then the delete() method will not be executed when the template is rendered. Instead, it will fail silently.

What do Dollar and Caret ( $ and ^) sign in Django urls mean?

$ and ^ are regular expression characters that have a special meaning: the caret means “require that the pattern matches the start of the string,” and the dollar sign means “require that the pattern matches the end of the string.”

For example consider the  following url pattern

urlpatterns = patterns('',
    url(r'^hello/$', hello),
)

Without the dollar sign at the end it will match any url starting with hello like

  • hello/satish
  • hello/gandham/
  • hello/satish/123/pqr

Note: use url(r'^$', my_homepage_view), to match root.

Right way to break Django code for debugguing

Django traceback is a very helpful tool in Django development. It saves us from the boring tasking of writing print statements to track variables.

Traceback doesn’t kick when there is no error.  There may be no coding errors but there is a flaw in our application logic which we want to debug. In such cases we can trigger Django traceback by adding assert False in our code.

example:

def hello_world(response):
test_var = "Something"
test_var2 = "another var"
assert false
return HttpResponse(test_var+test_var2)