0

Infusionsoft provides the following script / method of obtaining an affiliate ID. Now, I want to call that URL programmatically and just get back the affiliate ID - I don't want to redirect or go anywhere else, I just want the affiliate ID to use in a following query. I know there has to be a way to do this, but I have no idea what it might be...

--

Here is an example of the modified redirect link URL. You will need to change highlighted sections to enter your Infusionsoft application name and the URL of your destination website.

https://appName.infusionsoft.com/aff.html?to=http://www.example.com

If the prospect clicking on this link has a referral cookie stored on their browser, the partner will land on a page with a URL something like this:

http://www.example.com?affiliate=1234

The destination URL matches the one at the end of the redirect link and the referring partner's ID is part of the URL. If no cookie is found, the referral partner ID number is set to zero.

Justin Handley
  • 1,159
  • 1
  • 7
  • 14

1 Answers1

0

I think I've looked into doing this before. It seems to me that if you created a page to redirect to, for example, http://www.example.com/affiliateId.php, and on that page you echoed nothing but the affiliate ID, like so:

<?php echo $_GET['affiliate']; ?>

You could simply cURL that page and pull in the response. The problem here is that when you cURL the page, it's actually your server going to the page, and not the user's computer, so it always returns 0.

So, somehow, you need to get the user's computer to navigate to the page, perhaps through the use of an iframe or an ajax call and then pull the information after it's been rendered using a client side script.