I’ve been focusing a lot more lately on selling Clickbank products because it seems to be the best return on investment (ROI) in my experience. However, it’s slightly annoying that Clickbank doesn’t notify you when you make sales.
If you do a bit of digging around though, you’ll find that you CAN set up a notification system – but only if you want to get your hands a tad dirty.
It took me a few tries to get it right, and I had to splice a bit of code together from a few different websites to come up with what seemed to be the right stuff – so I’m just going to post it for you here along with a step-by-step guide to turning on Clickbank notifications.
(Note: You’ll need access to your server to do this, otherwise you would have to contact your web host to upload the file for you.)
1. Log in to your Clickbank account. That’s kind of a “duh” one, but you never know.
2. Click the “Account Settings” tab and go to “My Site“.
3. At the bottom of the My Site page is an “Advanced Tools” bar with an empty field beside “Secret Key” and “Instant Notification URL“. Click “Edit“.
4. You’ll need to request access to Instant Notification, so click that URL.
5. Read over the terms and agree to them. Submit the form.
6. Enter a Secret Key in the Secret Key field. The secret key can be up to 16 letters or digits and must be ALL CAPS.
7. Copy this code into a plain text file, (I use Notepad) and save it to your desktop as a php file. For example, I saved mine as cb.php so it was easy to remember. Make sure to change your email address in the code to your own before saving it as well as the secret key you came up with in the previous step.
<?php
function cbValid() {
$key='YOUR_SECRET_KEY_HERE';
$ccustname = $_REQUEST['ccustname'];
$ccustemail = $_REQUEST['ccustemail'];
$ccustcc = $_REQUEST['ccustcc'];
$ccuststate = $_REQUEST['ccuststate'];
$ctransreceipt = $_REQUEST['ctransreceipt'];
$cproditem = $_REQUEST['cproditem'];
$ctransaction = $_REQUEST['ctransaction'];
$ctransaffiliate = $_REQUEST['ctransaffiliate'];
$ctranspublisher = $_REQUEST['ctranspublisher'];
$cprodtype = $_REQUEST['cprodtype'];
$cprodtitle = $_REQUEST['cprodtitle'];
$ctranspaymentmethod =
$_REQUEST['ctranspaymentmethod'];
$ctransamount = $_REQUEST['ctransamount'];
$caffitid = $_REQUEST['caffitid'];
$cvendthru = $_REQUEST['cvendthru'];
$cbpop = $_REQUEST['cverify'];
$xxpop =
sha1("$ccustname|$ccustemail|$ccustcc|$ccuststate|$ctransreceipt
|$cproditem|$ctransaction|"
."$ctransaffiliate|$ctranspublisher|$cprodtype|$cprodtitle|$ctranspaymentmethod
|$ctransamount|$caffitid|$cvendthru|$key");
$xxpop=strtoupper(substr($xxpop,0,8));
if ($cbpop==$xxpop) return 1;
else return 0;
}
if (cbValid())
mail("YOUR_EMAIL_ADDRESS_HERE", "ClickBank - " .
$_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount']);
?>
Or you can download the file here. Make sure to change the file extension from .txt to .php before uploading it.
8. Put that file on your server using an FTP program. I chose to upload the file right to my root directly so the URL ends up being:
http://www.mydomain.com/cb.php
(Hopefully you already have one and know how to use it. If not, leave a comment and I’ll help you out.)
9. Back in the Clickbank site, enter that URL (http://www.mydomain.com/cb.php) – after replacing “mydomain” with your own of course – into the Instant Notification URL 1: field. I left the second field blank.
10. Before saving changes, click on “Test” to make sure everything is hunky dory. You should receive a test email to the email address you put in the php file.
11. A window should pop up to notify you that the test was a success. Hooray! Now you can save changes.
Now you’ll receive an email each time you make a Clickbank sale. Sweet, hey?
Time Sensitive Note: I’ve got another Clickbank tip coming up in Monday’s MamasOnTheWeb Newsletter (June 15th, 2009) – one that I just implemented and increased my sales – so make sure you sign up! It’s the form to the right –>>
If you liked this post, you may want to subscribe to my RSS feed and stay up to date with future posts. Thanks so much for visiting MamasOnTheWeb!




30 comments ↓
Yo Mama,
Cool post, I think most people don’t go through this process because they’re afraid they can’t program PHP, but as your simple step guideline suggests, all they need is Copy & Paste abilities!
Great Post.
Regards,
Perry Wolf.
Thanks Perry
It really is fairly simple and it’s SO NICE to receive emails now for sales notifications. No more signing in to Clickbank all the time.
Another nice thing about it, which you don’t get with ClickBank’s receipt email, is it tells you if, and who, the Affiliate is who referred the sale.
Perry.
According to the Clickbank blog, you can even make your browser “ding” when you make a sale! There are lots of variables you can add to that code. It’s pretty cool stuff.
Thanks. Excellent post. You made the whole process so simple to follow. You definitely have saved a lot of my time to try to figure from CB’s own guide.
Eugene´s last blog ..T Harv Eker’s The Wealthy Warrior – Self Mastery (6 – final)
Awesome Eugene, that was my goal. I’m glad it worked for you. Thanks for commenting!
I tried it. All I got in my email was this:
Product:
Publisher:
Affiliate:
Transaction:
Amount:
All details blank.
Hi Marco,
If I remember correctly, I’m pretty sure that’s the way it’s supposed to be. When you make a sale, it will send you some actual numbers.
Thank you for the great tip…. It’s so much easier when you’re shown how to do it. Will definitely give it a try.
Thanks Gaida, if you need any help just let me know. Thanks for stopping by.
Hi Cassie,
Andrew here. I was doing the same thing but I was wondering why it does not work for me until I saw your last portion, which is to get the results and do something with the results. Finally can get some fun going with my own customization ideas.
For those who wants to know if it is working, you should see these values (these are default values by clickbank for testing purposes) in your email after clicking Test on your Instant Notification URL:
——————————
Product: A passed in title
Publisher: (This will present your affiliate ID)
Affiliate:
Transaction: TEST
Amount: 100
——————————
Hope this helps for others and thanks Cassie for showing me the “light” or rather, the code.
Regards,
andrew
Internet marketing strategies´s last blog ..Using Free Traffic System For The First Time
Just one more thing, what comment plugin are you using such that it can show the commenter’s last blog post too?
Internet marketing strategies´s last blog ..Using Free Traffic System For The First Time
Hi Andrew,
Thanks for the clarification on the test email. I deleted mine so I couldn’t remember what it was supposed to say!
The plugin I use to show your last blog post is CommentLuv. It’s one of the few plugins I really love.
Thanks for stopping by!
[...] 4. Clickbank Sales Notifications [...]
Thanks Cassie,
I have been looking everywhere for tips on how to make the notifications work. I am going to set it up right now.
Colleen @ Buy Wholesale Product´s last blog ..Wholesale Drop Ship – Get Great Deals
@Colleen – I hope everything works for you! Let me know if it doesn’t.
What if you are using affiliate accounts and do not have access to the main web site? How can you get notified of a sale when the website is not your own?
Hi Susan,
Do you mean you don’t have access to Clickbank or just the website you’re using? If you don’t have an account with Clickbank where you can log in with your own email address, then you won’t be able to change the notification settings. If you mean the website, and you’re using a non self-hosted domain like blogspot or wordpress.com, then you won’t be able to access the server to upload the file to. If you have a webmaster though, you can ask them to do it for you. Hope this helps!
Hello,
Thanks for the detailed instructions.
I have an affiliate account with CB. I followed your instructions all the way through. Clicked on “Test” and it said “successful”, but I didn’t get the test email (as you mentioned). Now couple days have passed, I made a sale too, but still no emails from CB. I went and tested it again. It gave me the same “successful” message again.
Am I missing something?
Thanks again for your help.
Hey DFB. Sorry to hear it’s not working for you.
I’m not technical at all so the only idea I have is there is something wrong in the code for your cb.php file. Are you sure you have your cb.php file in the right spot according to the URL? Did you type the URL into your address bar? When I do, I just get a white screen. I’m guessing that’s what it’s supposed to do… (see, not technical).
Did you double check your email address? Did something else get changed somehow? Even one little miss-placed character or punctuation mark in the code can keep it from working.
Hello Cassie,
Thanks for your prompt response. As I mentioned earlier, when I test the script, CB says it’s able to communicate successfully with the script.
Also, if I give a wrong URL for the script, it gives me an “unsuccessful” message. Infact, earlier I had tried to host the script on Google Sites (and some other sites) but CB won’t accept it (because Google Sites and those other sites don’t support php scripts). Then I managed to find a proper hosting site and uploaded the script there and this time CB accepted it.
I copied the script from this post and made exactly 2 changes to it:
1. The secret key
2. Email address
Is there anything else that needs to be changed in the script?
Thanks again.
No, just those two things need to be modified. I’m stumped.
Did you check your junk box? Your ISP could have blocked it as spam.
Yes, actually I did that first thing when I didn’t get the mail. I’m using Gmail, BTW.
Anyways, I really appreciate all your help. Sooner or later, I’ll figure it out and post the resolution here.
Thanks.
That would be great DFB. Thanks! Good luck
Hi Cassie,
This is a great post, but unlike all the successful posts I have a problem, I see your are no techie but I will try anyway. I have done all as you suggest and when I click test it said there was an error, so I checked the URL adn this comes up first time:
Secure Connection Failed
http://www.jdfmarketing.com uses an invalid security certificate.
The certificate is only valid for the following names:
*.bluehost.com , bluehost.com
(Error code: ssl_error_bad_cert_domain)
any help here, anyone else posting on here had similar issues? Hope you can help!
Top job by the way!
Don
Don´s last blog ..Welcome to the website of Don Finch, UK Copywriter.
Hi Don,
Thanks for commenting! I’m sorry it’s not working for you. When I have those kinds of problems, I google the crap out of them until I find a solution. Hopefully someone else reading this may have an answer for you since I’m a bit stumped on this one.
Hello Cassie,
I’m back with the fix, as promised. Actually I didn’t look into this issue until today. Finally, I spent some time and managed to fix it.
The only thing I really changed was a couple of line breaks that crept in during copy n paste of the code from your page into file. The one that may have actually caused the problem was in the sha1 call (the really long line). I removed those extra line breaks, uploaded the code again and everything worked fine.
If you want, you can take note of this issue as a common pitfall people need to be aware of.
Otherwise you have done a great job of putting the instructions together.
Thanks for your help.
- DFB
DFB´s last blog ..PMP Exam Passing Score – Not a Number Game anymore
Thanks DFB. I was worried about possible line breaks so I also added a downloadable file to the post. Thanks for pointing that out. I’m glad you got it working!
Hey Cassie,
thank you very much for the code. I works perfectly for me!
Have a great day!
Alex´s last blog ..Cambios importantes en la publicación de artículos
Excellent Alex! I’m glad to hear that. Thanks for stopping by.
Leave a Comment