Please note that most examples shown here are meant to dilute the counters of received coins on your buttons. Unless you define another target, all coins will be sent to your account. Then you will be able to review where everything is coming from on your buttons analytics pages.
In all cases, the building of the buttonizer URL is described. To add it to your HTML code, you’ll need to set the URL to the href attribute of an
<a> tag and add a caption to be shown while the button is rendered, E.G.:
<a href="...">Tip me now</a>
Receiving tips and donations
Sitewide donations at the header or footer
These steps are here to show you how to deploy a global donations button to be shown either at the top or at the bottom of your website.
In all cases, public_key should be replaced with the Website Public Key and the button_id is the id of the button from the website you’re using.
- Create your website.
- Add the buttonizer controller code at the
<head>of your website template.
- Create your button and set the entry identifier as “
- Either starting the
<body>tag or just before closing it, paste the
<a>as it is generated.
That’s it. The button will show the counters for the donations received from any page of your whole website no matter the page where the button is shown.
Per-page donations on your blog
If you want to get a button and account the coins received for a specific page, it is as simple as leaving the entry id empty, so the buttonizer passes the URL to the API.
If you want to set a specific string as
entry_id instead of the whole page URL, you must:
- Set the button without an entry id.
- Pass the
entry_idand entry_title to the link as shown below:
Per-article per-author donations on your blog
For this case, you’ll have to define the email of the author as target_data.
Note: if you’re using a CMS, you may need to create a plugin to inject the link code programmatically.
- To invoke it by letting the page URL and title automatically set as item data:
- To get coins go to the author without referencing the source article:
Selling goods or services
Express 1-click purchases
When you have a storefront and you can inject the button link, you end up using
entry_data parameters after every item you have available on the page:
entry_data parameters may be empty when the user hasn’t logged into your store. So, you have two options:
- Do not render the link for the button for offline users and render it when they open a session so you can put their id on the
- Render the buttons without the
entry_dataparameters and, when you get the notification, manually take the proper steps.
As an option on checkout
If you want to put the button as a payment option on the checkout page of your storefront, it comes easier to track the purchase with the button, since you can pass the order id as entry_id and use the ref parameter for extra info you may need: