Open Beta: Anyone can sign up. It's all play money right now, no billing or payment will occur, so you can try all the
features and let us know how you like them or what you would like to see different. Send Feedback Here. Thanks!

Developer Reference

If you want to use the generator, please make sure to login first.

Plugin Embed Code Generator

  All actions are controlled through the BetterThanAds Plugin. Using a plugin allows our members to be tracked securely without sending information across the internet constantly. It also keeps your pages loading fast because they don't have to wait for our tracking features to load. In addition, non-members of our service will not be adversely affected through your participation, or tracked unknowingly.

Plugin Type: Upon successful subscription/payment, Post URL will receive a single variable via POST, 'bta_token'. This token can be used to verify payment was accepted (see API below). For subscriptions, this token will remain valid until the subscription is cancelled.
Site:
Price: (0.01 - 0.25 - keep it micro)
Post URL:
Description:


Your embedded plugin code:
- invisible -

API

  There are two public API calls available for web developers. Both are simple GET queries which return plain-text easily parseable in any language. They should be easy to implement quickly for any decent web developer. Note: These queries should only be done once a month and cached, as our billing process will not update more often than this. Violating this policy will make your site unnecessarily slower and may result in suspension of services.

  The first query provides a list of invalidated payment/subscription tokens for your site. In other words, newly cancelled subscriptions. Replace SITE_TOKEN with your own site token and GET the URL: http://api.betterthanads.com/cancels/SITE_TOKEN. The server will respond with a list of tokens cancelled in the preceding month, each separated by a newline '\n'.

  The second query will confirm that a single payment/subscription token is still valid. Replace SITE_TOKEN with your own site token and BTA_TOKEN with the token for the payment or subscription you want to confirm and GET the URL: http://api.betterthanads.com/confirm/SITE_TOKEN/BTA_TOKEN. The server will respond with 2 characters only, 'OK' or 'NO'. With a proper configuration, however, you should never need to use this.

Site Integration

  So how do we suggest integrating BetterThanAds into your site? First, you should add a bta_token column to your user table, with a default value of NULL. Next, create a "post-back" page to receive the bta_token from the plugin, this page will simply save the POSTed bta_token to the logged-in user's entry in the user table. Now, anywhere you want to check for a subscription, simply check if the user's bta_token is non-null and act appropriately (ie by not displaying ads or by linking to special content). Finally, you'll want to set up a cron job to run at the beginning of each month, which calls the "cancels" API query listed above, and sets bta_token to null for any that are found.

Copyright © 2009 Better Than Ads. All Rights Reserved.