d
Topic
Posts:
6
June 06, 2006

Referral/Affiliate System for Shopify This post is outdated

Hey Tobi, Awesome web app you got here. I am about to fully commit to using Shopify and opening up my shop. However, one of my concerns is that I will need an affiliate system where my customers can refer others into purchasing items from my shop. In turn, they make money per sale. So for example, the customer would have a referral link (http://carpets.com/ref=2920). And thus, all orders placed through that link can be tracked. Is there anyway I could personally code and add this feature to my own site? Or would you be able to do this (if not now, maybe in the near future)? Do let me know of your ideas and congrats again on such an amazing product!
i
Replies
Posts:
50
June 06, 2006

I’d like to second this feature request!

joe7 Member
Posts:
6
June 06, 2006

I can imagine this is something for the future? It would be a useful feature but I would say a lot of effort to implement.

Posts:
2055
June 06, 2006

This can’t really be done yet.

I’ll discuss this with daniel at work today..

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
matt Member
Posts:
2
June 06, 2006

i’ll add my voice here as well. this would be critical to some online sales driven through affiliates. even just allowing a variable to be trapped with the order would be excellent.

Posts:
6
June 09, 2006

Tobi, any leads on this topic? I know quite a few shopify members wanting this feature.

On my personal business, Play4Rewards.com I make use of this. Its pretty easy and manageable to implement (at least for me). Please look to it, thanks and keep up the great work!

Posts:
42
June 09, 2006

I’m not in a hurry tobi, it’ll take me a while to build up enough expertise in writing themes and working with Shopify to feel comfortable using it on a clients’ site.

However, I do think it would be a great feature eventually.

In the meantime, if I did have a client that was a great fit with Shopify, I could just charge them a fee for “setup” or “configuration” to cover my time involved… in addition to the design of course.

Thanks

Posts:
42
June 09, 2006

Heh, I replied to the wrong thread LOL. Just ignore my post I guess :)

Posts:
2055
June 10, 2006

Just thinking out loud here:

If a client arrives at a shopify store with ?referrer=XXXX i could make it so that orders will display this referrer in the notes section…

This would let you implement a referrer system yourself until we come up with a good one size fits all solution.

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
Posts:
6
June 10, 2006

Sounds good tobi,

I could probably implement the referral system for my site and if anyone needs it, I could probably help them with it as well.

Posts:
6
June 10, 2006

Sounds good tobi,

I could probably implement the referral system for my site and if anyone needs it, I could probably help them with it as well.

edwin Member
Posts:
14
March 03, 2007

Hey everyone,

Trying to search for something like the mentioned ?referrer=XXXX”.

Is this available?

Thanks,
Edwin-

Posts:
2055
March 03, 2007

It would be possible to do this using javascript right now. Store the referrer parameter as a cookie using JS and then filling a hidden input field on the cart page which attaches the referrer as a note.

I’m not aware of anyone doing this yet but its entirly possible!

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
edwin Member
Posts:
14
March 03, 2007

Thanks Tobi.

I can’t believe that no one on Shopify has done this.

Is anyone out there that has implemented this and is
willing to help out a man in need? :-)

edwin Member
Posts:
14
March 05, 2007

nudge …

Just bringing this to the top. :-)

Is there anyone implementing a Referral/Affiliate
program for their store? People are asking me for
it. I’m sure I’m not the only one.

I know I’m being lazy here, but don’t want to
re-invent the wheel. Can someone help a fellow
Shopifier out?

Thanks,
Edwin-

Posts:
3
March 05, 2007

I know this is not the same thing.. but how do we get an affiliate token to add to add to new shopify signups? I would like to add my code to sites i’m building.
Also, what sort of rates do we get for this?

Ant

Posts:
2055
March 05, 2007

Anthony: This is different. We have created a basic affiliate system for shopify but haven’t really released it yet.

Once released you ( as a affiliate ) will get 33% of our proceedings of the store you signed up for their first 12 invoices ( we only send an invoice if the total amount is more then 5$ so you won’t be scammed from your affiliate money if the store needs another 6 months before starting to sell )

What do you think?

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
Posts:
3
March 19, 2007

Tobi: Yes, thats what I’m after – however I would prefer it if there was no expiry on the payments, even if it meant a smaller %.

KJ Member
Posts:
1
Last edited July 11, 2007

Tobi I am also interested in the affiliate token system i too would prefer a permanent residual monthly income for as long as the client shopify account is active what is the current status of the token system and are there any plans to upgrade to what anthony and i are asking for.

Posts:
149
July 11, 2007

Consider the call for ongoing payments thirded.

Winners - 2008 McFarlane Prize for Excellence in Australian Web Design: http://mcfarlaneprize.com/ Finalists - 2007 McFarlane Prize for Excellence in Australian Web Design: http://mcfarlaneprize.com/ HQ: http://www.propellerglobal.com/ | Domains & Hosting: http://domains.propellerglobal.com/ Shopify Stores: http://shop.proplaster.com.au | http://www.thekhalsaraj.com | http://www.productivegardens.com.au | http://www.elephantrose.com.au | http://www.stradbrokeweddings.com.au | http://www.solution-central.com.au
danetidwell Shopify Partner silverloft.net
Posts:
40
July 11, 2007

I think there are three separate topics discussed here and throughout the forum that refer to affiliates.

1. Store Affiliates – People who refer others to your Shopify store get rewarded.
2. Shopify Affiliates – Current shop owners who refer others to Shopify get rewarded.
3. Refer a Friend – A form at a Shopify store that lets someone enter the email addresses of their friends with some message generated saying its a cool site or something similar.

If this thread could be seperated out into two it would be easier to track how many requests for a feature are actually being asked. Do/can/will admins do this on here?

Also, what about a top level thread for “Feature Requests”? It’d make it much easier to keep things orderly if there’s a specific place for people to make them all. I’ve seen several places people ask for things and I’m pretty sure the Shopify guys don’t have the time to review the entire forum to see what people are asking for most.

- Dane Tidwell Creative Director Silverloft consultancy http://silverloft.net -
Posts:
14
August 17, 2007

For those still interested, I came up with a solution to the affiliate system problem. I followed Tobi’s advice and customized the code at http://www.quirksmode.org/js/cookies.html, to store the referrers affiliate id in a hidden input field called ‘note.’ My JavaScript skills are a bit shabby but it works. The code only takes up a few lines but if any of you can simply it, I’m open to any ideas/advice.

I created affiliate.js and called it in the theme.liquid template. Here’s the code:

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

window.onload = function ()
{  
  name = "referrer";
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS, "gi" );

  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    createCookie(name,results[1],7);
}

Next, I added the following code to the cart.liquid template:

window.onload = function readCookie() {
    var nameEQ = "referrer=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
           if (c.indexOf(nameEQ) == 0)
                var thevalue=(nameEQ+c.substring(nameEQ.length,c.length));
                document.getElementById('note').value=thevalue;
    }
    return null;
}

Lastly, I placed a hidden input field inside the form in the cart.liquid template called ‘note’ like so:

<input name="note" id="note" type="hidden"/>

Now if a customer arrives at your store with /?referrer=XXXX at the end of the url, and purchases something, a note with ‘referrer=XXXX’ will be attached to that order. You can see the code in action at my store (link in my sig.)

Hope this helps!

- Dee

Dee http://147street.com
danW Shopify Advisor
Posts:
1037
August 17, 2007

Very cool Dee. You should create a writeup and add it to the wiki.

Dan - http://www.xtremechargers.com
danetidwell Shopify Partner silverloft.net
Posts:
40
August 18, 2007

Bleh—

This looks great! I’m probably doing something wrong but when I add

window.onload = function readCookie() { var nameEQ = “referrer=”; var ca = document.cookie.split(’;’); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==’ ‘) c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) var thevalue=(nameEQ+c.substring(nameEQ.length,c.length)); document.getElementById(‘note’).value=thevalue; } return null;
}

to cart.liquid it just spits out the code. Is there something I need to be wrapping it in or a specific place its supposed to go? My url is anonymousproduct.com (password is passw0rd /the oh is a zero/) if you’d like to see what I’m talking about.

Thanks for the code though, it’ll be a boon for me!

Dane

- Dane Tidwell Creative Director Silverloft consultancy http://silverloft.net -
Jared Burns Shopify Advisor get.sy
Posts:
496
August 18, 2007

Make sure you wrap it in…

<script type="text/javascript">
   ...
</script>
Jared Burns, CEO at Getsy (http://get.sy)
Posts:
14
August 19, 2007

Yes Dane, make sure you wrap the code in script tags like Jared suggested.

I placed my code inside the script tag that was already in the cart template. Just look for the function called remove_item(id){...}, and paste the code after the last bracket.

Dee http://147street.com
Posts:
3
August 20, 2007

Ok,
I have set up my store the way I think it should be done for affiliate sales tracking, after reading what all you way smarter than me people have had to say about it and thanks to donna k’s post.

Now how do I go about testing it to make sure it works?

Where will the note field show up for me to see it?

When I have a new affiliate I just give him a new link like

mysite.com/?referrer=1234 and it will show up on the order right? I just want to make usre I understand before I give the link to an affiliate and it doesn’t work. Thanks ahead of time for your advice. Kevin

Posts:
14
August 22, 2007

Kevin,

Yes, you’re correct. The affiliate id will be attached to the order in a note. To test it, just visit your site with /?referrer=someid at the end of the url, and complete a purchase. In your shopify admin, you’ll see a note saying “referrer=someid” attached to the order.

Dee http://147street.com
Posts:
3
August 22, 2007

Thank you Donna, I tried it but there was no note field for my order. I am wondering if I placed the code in the right place in Theme.Liquid.

I actually just pasted it in the template inside Script tags, but I notice that you said you called it into theme.liquid after creating affiliate.js? What does this mean. Do I have to create this file in another program, or is it ok that I just pasted the code in the script manually. thank you for your help. Kevin

Posts:
14
August 23, 2007

Kevin,

You’re missing the code that goes inside your theme.liquid template. You can either paste it inside script tags or save it in a separate file and call it.

To call it, open up a text editor, paste the code in there, and save it as affiliate.js. Next, upload it via your Shopify Admin, and paste the following inside the <head> tags of your theme.liquid template:

   {{ 'affiliate.js' | asset_url | script_tag }}

You should be all set after that.

Dee http://147street.com
Posts:
1
September 25, 2007

I cant seem to get this right. I followed all the steps and can not get the note to post. Is this because I am using the test payment gateway?

Simplyand Shopify Partner 3sunset.com
Posts:
197
January 08, 2008

@chinoborracho

Make sure that you are not using the id=”note” anywhere else on the page. I have it some where else and that caused the problem for me.

Log in or sign up for an account to reply.

This thread has been closed! You will not be able to reply.