1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Write a script?

Discussion in 'Hire a Freelancer' started by fletcher6490, Nov 2, 2012.

  1. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    I am an affiliate for a company and when someone clicks my referral page, a cookie is put on their computer so that at a later time if they go to the site again I will still be their sponsor if they sign up. My question is, would it be possible to write a script so that when someone goes to my WP site that I created, that same cookie will be put on their computer and if they ever join the company I will show up as their sponsor?
     
  2. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    If this is possible, I am definitely interested in paying someone to do this for me.
     
  3. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    If I understand correctly, your referral link goes to a site that you don't own (which places the cookie; we'll call it Site A). You want the same cookie to be placed when someone visits the site you do own (we'll call it Site B). So if someone visits Site B and later visits Site A, you want to show up as their sponsor.

    If this is the case, the answer is no. Cookies are stored by domain. One domain's cookie will not affect another domain's cookie. If these two sites were on the same domain, sure, but that is not the case in my assumption of your situation.
     
    • Thanks Thanks x 1
    Last edited: Nov 3, 2012
  4. dario111cro

    dario111cro Junior Member

    Joined:
    Feb 5, 2012
    Messages:
    180
    Likes Received:
    203
    Location:
    cloud
    Only way to do it would require taking control over users PC/browser, since cookies are bidden to domains. Another way would be opening referral page in background at page load.
     
    • Thanks Thanks x 1
  5. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    Thanks for the info guys, I wasn't sure if it was possible. I'm intrigued by the idea of opening the page in the background though....
     
  6. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    Is there a way to do that without it being just a pop up?
     
  7. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Best to use an iframe if your advertiser doesn't use framebreakers.
     
  8. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    What would be my best way to do that? I've actually never set up an iframe before
     
  9. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    Ok, I think I've got it all figured out. I inserted this <iframe height="0" width="0" style="visibility:hidden;display:none" src="http:xxxxxx"></iframe> into the header.php and it seems to be working
     
  10. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Well display:none; means it won't load in the user's browser, meaning they will never visit your affiliate link. Best to do visibility:hidden; width:1px; height:1px; and put it somewhere inconspicuous.
     
  11. jilla2005

    jilla2005 Newbie

    Joined:
    Jan 23, 2012
    Messages:
    11
    Likes Received:
    1
    Occupation:
    System Administrator
    Location:
    Seattle, WA
    Not possible to do it the way you want to do it.
     
  12. fletcher6490

    fletcher6490 Junior Member

    Joined:
    Jul 15, 2011
    Messages:
    149
    Likes Received:
    41
    I've cleared my cookies and tried my method and it works perfect on my end. I'm going to PM you and have you try it out and let me know if it works for you.