Issue with Affiliates plugin not creating cookies

Hi,

I'm trying to set up the Affiliates plugin with Pro Sites and am having problems. After coming across something in a forum that mentioned caching could be a problem, I contacted my host, WPEngine, since I know they cache everything. After doing some testing, it looks like caching is most likely the problem.

WPEngine is willing to work with me on it and create an exception so the cookies will work. I just wanted to see if you had any suggestions for anything I can tell them to speed things along?

Also, I was wondering if you've encountered this before and if you have any suggestions. I want to get it working as soon as possible, so if you have any experience with this, your feedback would be appreciated.

Thanks,
Todd

  • Predrag Dubajic
    • Support

    Hi @Todd Heitner,

    Hope you're doing well today :slight_smile:

    I must say that I'm not sure how could we speed this up for your host, but let me ping developer @Marko Miljus here so he can give his opinion on this one.
    Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Predrag

  • calvinrogercanas
    • New Recruit

    Hey there @Todd Heitner,

    Hope you're well! :slight_smile:

    I am sure Marko, the lead dev of this plugin will surely reply when he is working. But they may reply slower than normal since they are busy building and upgrading our awesome plugins :slight_smile:

    Best Regards,
    Calvin

  • Todd Heitner
    • The Incredible Code Injector

    Hi, I just wanted to give an update while we're waiting. I contacted my host and they said:

    I've whitelisted all cookies and arguments from cache that I am able to see the plugin making. Have you contacted the plugin author on this to see if they have any additional recommendations on cookies, arguments, or paths to exclude from our caching? I'm sure they likely run into this issue all the time so they should have some more plugin specific insight on this.

    Despite the changes they've made, it's still not working, so they need your input.

    Thanks,
    Todd

  • Marko Miljus
    • The Incredible Code Injector

    Hi guys,

    I am sorry for this delay here.
    This is the cookie name set by the plugin 'affiliate_' . COOKIEHASH so I guess they should whitelist that one.

    We're using standard constants when setting a cookie: COOKIEPATH and COOKIE_DOMAIN so I guess there should be no clashes but they would know better.

    Cookies are set on 3 places in the affiliatepublic.php on lines 606, 623 and 672 so they can take a look and change things there if needed.

    If any code changes are needed from my side, I'll be happy to help as long as those don't affect functionality of all our other members and their websites where Affiliates plugin is installed :slight_smile:

    Cheers,
    Marko

  • Todd Heitner
    • The Incredible Code Injector

    Thanks so much for the reply. I passed along the information to my host but they still haven't been able to resolve this issue. Here is their reply:

    It looks like the developer is referencing the affiliate_ cookie being set and whitelisting this from our caching. I can confirm that all cookies matching affiliate_* are whitelisted for your install currently. You can confirm this by checking the cookies loading on your site in the Chrome Dev Tools, as shown in the following screenshot:
    (attached)

    I'm still seeing the same issue with the affiliate debug mode still showing no cookies current set for the affiliate, despite this cookie being set without issue. I also see that cookies matching _referrer_og* have been excluded as well, in addition to the ref=.+ php argument.

    I definitely don't want to just kick this back to you without trying anything additional, so I've checked out the affiliatepublic.php the dev referenced in your affiliate/affiliateincludes/classes directory. The only additional information I was able to glean from this file is that sometimes a noaffiliate_ cookie is set if the conditions aren't properly met. I've tried whitelisting this cookie as well just to ensure that all parts of the argument are satisfied on our end. I tested the http://donedealwebsite.com/?ref=testmarch3-09 URL after trying this out and am unfortunately seeing any change.

    As a final test, just to fully exhaust the options I seem to have available, I tried disabling object caching and PHP eaccellerator, then purged varnish cache and checked the affiliate URL once more in an incognito chrome window and I am still not seeing any change to the text shown by the affiliate debug banner.

    We're definitely happy to work with you further on this, however I'm really grasping at straws trying to find anything additional to exclude from our caching. Since the developer does appear to be so graciously responsive in this case, perhaps he has some insight on why the functionality does not appear to be there despite us showing that the affiliate_ cookie has been allowed.

  • Marko Miljus
    • The Incredible Code Injector

    Hi Todd,

    When I click on the link provided, I can see that cookie is set:

    Name: affiliate_07c89a11834592971e379e7f4588690c
    Content: afff14d18e40c77fcc315836429010aaba7
    Domain: .donedealwebsite.com
    Path: /
    Send for: Any kind of connection
    Accessible to script: Yes
    Created: Thursday, March 12, 2015 at 2:53:44 PM
    Expires: Friday, March 11, 2016 at 2:53:44 PM

    Does it work for you as well? Or it sets the cookie now but doesn't record referrals?

    Let me know.

    Cheers,
    Marko

  • Todd Heitner
    • The Incredible Code Injector

    Actually, we were relying on the Affiliate Debugging add-on to tell whether the cookie was set. It just occurred to me that maybe after they made changes to allow the cookie that possibly the cookie is getting set but that the Affiliate Debugging add-on just isn't reporting accurately. Possibly caching is interfering with that, even though an actual cookie is being set.

    I checked and the number of clicks for that link is way higher now than in the beginning, probably from it being tested many times. The Affiliate Debugging add-on would say no cookie was set, but apparently it was.

    Now it looks like clicks are being tracked, but not signups. Is there anything else that needs to be done? By the way, the actual signup page is here:
    http://donedealwebsite.com/create-your-website/

    That's not linked to on the home page because things aren't working yet and it's a live site.

    Thanks,
    Todd

  • Todd Heitner
    • The Incredible Code Injector

    @Predrag and @Marko Miljus
    No problem, I just enabled it.

    Just a few more details that may be useful:

    Here is the signup form:
    http://donedealwebsite.com/create-your-website/

    I'm using Gravity Forms for the signup form, and the first time I tested it, the signup was tracked, but after that I guess caching kicked in because it hasn't tracked it since. In the staging area (where there is no caching), the signups get tracked.

    I don't know why the clicks are getting tracked but not the signups, but it has to be related to caching somehow. The host has been good about making exclusions for whatever is needed, but they just have to know what to exclude.

    After the signup, the user is redirected to /pro-site/ so they can select which plan they want. I haven't really made it that far in the testing. It didn't work the first time I tried it, but at that time I didn't have the code added to wp-config.php to credit the affiliate for future payments. I have changed that now, but things aren't getting tracked so I'm not sure if that will work or not.

    Thanks!
    Todd

  • Todd Heitner
    • The Incredible Code Injector

    @Marko Miljus and Predrag Dubajic,

    Hi, I just wanted to mention that if you're doing testing, it's OK to turn on the Affiliate Debugging for a minute or two at a time while you're checking something, but please turn it off after. It's a live site and it not only shows up a the bottom of my site, but all my customers' sites on the network. I'm getting complaints about it. I think it was my host that was turning it on for testing, but I thought I should mention it to you too just in case. If you turn it on, just be sure to turn it back off when you don't actively need it.

    Thanks,
    Todd

  • Predrag Dubajic
    • Support

    Hi @Todd Heitner,

    Ok I have access now, so I checked your site, created new affiliate account and tested registration with the affiliate link, and as you can see from the screenshot below it displays both clicks and registrations.
    Can you test it now and confirm if it's also working on your end?

    Best regards,
    Predrag

  • Todd Heitner
    • The Incredible Code Injector

    Hi @Predrag Dubajic

    OK, now the click and the sign up is getting tracked but not the payment. So it's progress. Did you change something to get the signup to get tracked?

    I just moved it from test mode to live, but if you need me to put it back I can put in the Stripe testing API info again. Or if you can think of anything that might be preventing the payment to get tracked, that would be great.

    Thanks,
    Todd

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.