Primary

Varnish Cache

If you are using the Varnish Cache web application accelerator and have it configured to drop cookies on the front end, then affiliate links will not be effective.

Remove all but the Affiliates plugin cookie

Based on this article – a shorter version of the one below – remove all cookies except wp_affiliates which we use to recognize referred visitors :

if (req.http.Cookie) {
  if (req.http.Cookie ~ "wp_affiliates=") {
    return (pass);
  } else {
    remove req.http.Cookie;
  }
}

Based on Removing all BUT some cookies – removes all except the cookie named wp_affiliates, which is the one required for affiliate links to work.

sub vcl_recv {
if (req.http.Cookie) {
    set req.http.Cookie = ";" + req.http.Cookie;
    set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";");
    set req.http.Cookie = regsuball(req.http.Cookie, ";(wp_affiliates)=", "; 1=");
    set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", "");
    set req.http.Cookie = regsuball(req.http.Cookie, "^[; ]+|[; ]+$", "");

    if (req.http.Cookie == "") {
        remove req.http.Cookie;
    }
}

Resources