Hi everybody I know you can set up new links to your internal pages for your affiliates, for example mysite/amember/go.php?r=999&i=l999. But that means you have to create these links one by one, and we have a few thousand pages. Is it possible to deeplink to any page on your site without having to create a special link in amember admin? Something like mysite/amember/go.php?r=999&i=whatever-URL-I-Like. Thanks!
I'm currently looking for an answer to this question as well. Even if someone can say "this isn't possible", that would help.
You could probably create a custom php page that would cookie the member using the r= code, then redirect based on the i code. Then amember cookie can be set in php by using: (100) is the affiliate id, so you'd need to retrieve this from the r code. include('/home/yoursite/www/amember/config.inc.php'); aff_set_cookie(100); $db->log_aff_click('100', 'Link'); David
Thanks David, The code you gave looks like it will record the affiliate click, and that's pretty much all I would require. You mentioned something about redirecting based on the i code, which as far as I can tell, is encoded in the database in a way I can't figure out, and therefore am unable to use. I could, however, use a new code (i.e. - url) to reference a destination URL if ever required. However, I don't foresee needing it for this application, as there would be no redirect to take place. For others who may need a more "turn key" solution, here's a bit of code you can add to a PHP page to make this happen: Code: $affiliate = $_GET['r']; $url = $_GET['url']; if ($affiliate != '') { // Incoming affiliate link include('/home/yoursite/www/amember/config.inc.php'); aff_set_cookie($affiliate); $db->log_aff_click($affiliate, 'Link'); if ($url != '') { // there's a redirection header("Location: $url"); exit(); } } Safe coding practices suggest you 'sanitize' each GET variable before using them. There are several such functions available online to help with this.
so is there any updates / feedback available on deeplinking using amember's built in affil program with the code provided in this thread thank you,