1. Amit Sharma Silver

    Digital Marketing & Strategy Consultant at Emotion Associates Limited

    16 February 2007 12:45pm

    Amit Sharma

    Hi,

    Have a query which I think should have a simple answer but maybe not...

    We have recently put in place a simple referral scheme on a cost per acquisition basis. Hence, every visitor that arrives on our site from a particluar website e.g. www.iwasreferred.com gets a discount if they add the promotion code to the Promo Code field on the application page.

    I was wondering if there was a simpler way of doing this where they would not have to physically enter the code but the url from which they were referred was automatically added to that promo field.

    Any ideas or advice will be appreciated.

    Regards

    Amit Sharma

  2. dan barker

    E-Business Consultant at Dan Barker

    16 February 2007 17:47pm

    dan barker

    hi, Amit, how are you?

    Do you code your site yourself? Are you using off-the-shelf software? Do you have a development team?

    Yes, you can do this simply:

    1.  What you need to do is grab the referring URL (or, better, domain) when a visitor first arrives at your site.
    2. Store this in what's called a 'session variable' (a variable that can be called by a page at any point during their session on your site).
    3. As the 'checkout' page is loading, check for the existence of this session variable &, if it does exist, use it to pre-fill the promotion code field.
    A couple of hiccups you might face:
      • The referring URL may not be what you expect (for example, you can view e-consultancy by going to http://193.41.101.10 , some sites allow you to use .com or .co.uk, etc)
      • Very occasionally, visitors use browser plugins to block the ability to grab the referring URL
      • If a visitor goes to your site from one of your chosen referrers, doesn't buy straight away, and then comes back a while later, you will have lost the session variable & will be unable to see where they came from.
        A couple of workarounds that may better achieve your objective:
        • Instead of using the full URL, just search it for the existence of a particular string. For example, if you want to reward referrals from hotmail, look for "hotmail" in the referring URL, rather than "http://www.hotmail.co.uk"
        • Instead of using referring URLs, create specific promo URLs & ask the sites that are linking to you to use those. For example http://www.yourwebsite.com?promo=1234
        • Setting a cookie on the visitor's machine containing the referrer information (or the promo code, if you choose to use the above method) would allow you to reward them even if they chose to wait a few days between their first visit & their purchase

        Is that of any use?

        daniel

      1. Amit Sharma Silver

        Digital Marketing & Strategy Consultant at Emotion Associates Limited

        19 February 2007 09:21am

        Amit Sharma

        Hi Daniel,

        Very helpful indeed. I guess the "problem" is that our IT department does code the website and all development is done internally. They have been working on this and have promised to have it all resolved but it hasn't happened and I was hoping there was a quick workaround.

        Your post was extremely helpful as it primarily confirms all the research we have done in the past on the subject and also the fact that we are going to have to wait for our IT team to sort this out for us.

        Thanks again for taking the time to reply.

        Kind regards

        Amit Sharma

      2. Bob Browning

        Retired at Retired

        19 February 2007 18:28pm

        Bob Browning

        Just to add a little to Daniel's excellent reply.  I would recommend his final option of including some sort of code in the URL your referring site uses to identify them.  For example http://www.mydomain.com?id=associate.  The things after the question mark is called a search string and get to it in javascript with location.search. 

        The javascript to pick up the code and put it into a cookie is fairly trivial (do view source on www.handleanything.com for example - around line  100.)   No doubt it can be improved if you have a lot of associates. 

        Then picking up the cookie value and  storing it is not rocket science.  Alternatively if you have an promotion code you can probably put the promotion code into a cookie and use javascript to copy it to your existing web form. 

        As long as you have some way of injecting some Javascript into the existing site then it shouldn't take very long to do. 

        Bob

      3. Amit Sharma Silver

        Digital Marketing & Strategy Consultant at Emotion Associates Limited

        20 February 2007 12:26pm

        Amit Sharma

        Hi Bob,

        Thanks for that. Apparently it seems our problem is with someone "sticking their finger out " and doing the job... as you said not rocket science.

        Thanks for this. I have forwarded both posts to our technical team and hopefull we will have a result somewhere along the line.

        Thanks

        Amit

        On 18:28:51 19 February 2007 textor wrote:

        Just to add a little to Daniel's excellent reply.  I would recommend his final option of including some sort of code in the URL your referring site uses to identify them.  For example http://www.mydomain.com?id=associate.  The things after the question mark is called a search string and get to it in javascript with location.search. 

        The javascript to pick up the code and put it into a cookie is fairly trivial (do view source on www.handleanything.com for example - around line  100.)   No doubt it can be improved if you have a lot of associates. 

        Then picking up the cookie value and  storing it is not rocket science.  Alternatively if you have an promotion code you can probably put the promotion code into a cookie and use javascript to copy it to your existing web form. 

        As long as you have some way of injecting some Javascript into the existing site then it shouldn't take very long to do. 

        Bob

      4. dan barker

        E-Business Consultant at Dan Barker

        20 February 2007 14:02pm

        dan barker

        hi, Bob, Amit,

        I agree with Bob, it is not 'rocket science'. I would recommend doing the processing on the backend though (in php/asp/whatever you're using) - there are a few disadvantages if you do this with javascript & no advantage that I can think of.

        The 'search string' is actually called the 'query string'. I think the confusion is that in javascript you gemerally use 'location.search' to grab its contents.

        daniel

      5. Bob Browning

        Retired at Retired

        20 February 2007 14:57pm

        Bob Browning

        I stand corrected on the name.

        The only advantage of the javascript is that it is often easier to get access to the page layouts than the programs.  In general I would agree best and safest done server-side.

      Reply to this thread

      Log in to reply to this thread or join Econsultancy for free so you can post to our forums along with other benefits.