We have had a lot of interest about our new Javascript SDK and thought we’d write a quick tutorial to get things going. Here is a list of examples showing how you can use the JS SDK to reward enable common elements on your website:
1. Reward-enable a form (or button):
If you want to reward enable a form you can attach an earning event to the “onClick” event of the button in the form:
<form>
...
<button onClick='_ptq.push(["invite",{"points":10}]);'>
submit
</button>
</form>
DEMO – Click the invite button below and earn 10 points:
2. Reward-enable a download link (or any link):
Attach the earning event to the “onClick” event of the download link:
<a
href="/a-really-interesting-file.pdf.zip"
onClick='_ptq.push(["download",{"points":10}]);'>
Download
</a>
DEMO – Download the file below and earn 10 points:
3. Reward-enable a page load:
If you want to reward enable the viewing of a page, you can attach the earning event to the “onLoad” event of the body tag.
<body onload='_ptq.push(["view",{"points":10}]);'>...</body>
DEMO – View this sample page and earn 10 points.
I hope this helps you get going and shows how to attach points to different kinds of events. You can always reach us at api@punchtab.com if you have further questions.

This, tied in with custom rewards, actually is giving me a pretty good idea.. Now if only I could make more free time in the day!
Stuart, let us know if we can help (well, apart from making more free time in the day). We’d love to learn from what you’re up to.
Can you enable a form so that a user can only get points from submitting the form ONCE? For example, I may offer points to have people sign up for newsletter but don’t want them to keep coming back every day and trying to subscribe just to get extra points.
Thanks
I would then suggest to read to call the JS SDK after validating this data on your side.
Thanks for responding. Can you explain a littlemore about what you mean by this so that I can do a littlemore research to figure out howto do this?
Thanks
Brian, please contact us at support@punchtab.com for more details.
howdy, very good page, and a decent understand! at least one for my favorites.
hi
I have installed punchtab in my drupal site http://www.krazykoder.com but I am finding it to difficult to how to reward users on custom events.Well the basics reward events works well like (facebook like,tweet,first time site visit…)
So I found a blog of howto install custom events for rewarding user with points..here is the walkthrough i tried to get it started for me:-
1.)copy-pasted the JS snippet from installation page at the end of body tag.Copy-pasted the sidebar widget code within body tag.
2.)activated the JS SDK from settings in dashboard of my punchtab account..and created a custom catalog for it(As the default catalog doesnt supports when i have to activate the JS SDK..plz correct me if i am wrong).
3.)copy pasted the below code to reward my users..if they click the below link..
click me
4.)but when a punchtab registered user clicks on this link ..nothing happens..I mean No points are rewarded to that users ..
so please tell me what wrong step I am taking..and also provide me with correct steps to get it started to my site..
please help..
tks
hi all,
i have implemented punchtab on my drupal site, it works great for basic events..but for custom events there are lot of confusion for me to implement it. I have enabled the JS SDK from dashboard but when a user clicks on the link
Download
,nothing happens.
Also i have called the ” _ptq.push(["invite",{"points":10}]);” in the script tag of html file..so the user gets rewarded vd 10 points when they visit the same html page for the first time..afterwards nothing happens..so how can I use this function to reward my users as soon as the user posts some content on my site..
Also one more doubt is when i am enabling this custom JS SDK ,I wont be able to use the default catalog that punch tab provides.
Please help me to solve my queries.
tks in adv
Vilask
Could any one tell me exactly where to add the above codes in the install snipper we got?
testing
that great…
nice
good
nice…
I am trying to put this everywhere on my site
And neither the tab or activity shows up.
what do I need to do to add the activity/tab so customers can click on the tab?
Awesome already for my website!!!!!
testingg
I want to reward enable some functions on a joomla site (php)
But php scripting is to hard for me to edit. I’ve tried everything
What I want to do:
I have a shoutbox (ajax) and everytime anyone writes in it, they’re awarded points.
The problem is I can’t figure out where the action is for posting a shout
cool
nice
innovative idea supperb work keep going punchtab….:))
cool!
nice!!!
very helpfull
Thx for the options!
wena
Is for each action reward a differnt vode, thats a bit complicated, is there no way to put it in a formula that can be reused.I need code programing skills for this.
What do i have to do if i want to reward watching a video on a webpage please?
How can i put those reward systems in wordpress ?
Any idea’s on how to embed the code into a mailchimp form?
if i use the wibiya toolbar (which has PunchTab app in it) do i need to put these codes into my site? or does it do it automaticly?
awesome
great!
cool
it’s not working on my website
read the FAQ
how can I put these punchtab flags next to likes and g+’s?
testing..
yhm
awesome!
cool stuff!
nice
awesome!
great job
is there a way to give rewards based off of the dollar amount? for example, can we give 100 pts per dollar spent on our site? so if someone purchased a 5 dollar item off our site, they would gain 500 pts?
If you go to PunchTab, click on the Loyalty program and then click on Instillation. On the bottom left side of the screen you will see 4 steps. Click on #4 Shopify COnfiguration (I use Shopify so I’m not sure if this is the same steps using a different platform).
Then on the right is shows:
Enter Rewards Points for currency unit (example: Dollar) spent
This allows you to set the amount of points earned for each dollar spent and then click save.
I am using Shopify and wanted to use the custom “addtotimeline” option for the loyalty program. I’m not exactly sure what this option does, but I’m hoping that if a custom uses this that it adds a link to http://www.ProjectFey.com and that they can add a comment about the site as well.
Can someone please tell me EXACTLY what code I need to add and where to add it into the Shopify site that would be great. Also does it need to be entered into a specific ‘line’ as well?
I’m not savy when it comes to this sort of thing and I’ve been trying for hours without success.
great!
great man!
cool
wow~ nice
need more points!
very good! Thank you!
I need a developer to help me customize/incentivize my punchtab.
Thanks!!
helful tutorial.
like it!
The download link is not working.
The file is downloaded but no points are awarded. (Win7/Chrome)
The download link is not working.
The file is downloaded but no points are awarded.
like it again!
Thanks.
Thanks!
How can we enable the JS SDK enabled reward actions on a Joomla based website?
thenk you!
great thank you
Thank you.
thanks!!!
very nice! thanks!!!
thank you very much!
cool……….
So with this I could reward a certain number of points for a person viewing an entire video?