- Thoughtleadr Publisher Account with Public Key
- Basic HTML Knowledge
Important If you are testing a development system, make sure to add the query parameter “?debug=true” to the end of the Ad API URL, like so:
This will give you dummy ads to test against regardless of advertising inventory in production. Additionally, you can add the query parameter “noads=true”, if you want to test to see if the page will work when there is no ad inventory.
The thumbnail is a small preview version of the advertisement used on home pages or in lists of related articles. Here’s how you would retrieve the thumbnail URL:
These can be used to either directly write out html image tags:
OR can be incorporated into a more complex frontend framework.
//someone clicked on a facebook sharing button tldr.click(tldr.CLICK_TYPE.fb_share); //someone viewed a full page image ad tldr.impression(tldr.IMPRESSION_TYPE.fullpage);
When this call is made, an img tag is added to the page making a request back to TLDR’s system to record the action. For a complete list of impression and click events, please see the TLDR Object Model below.
Ad Data Methods
These methods will allow you to extract information about the ad for the current page.
|tldr.ad_available()||Boolean||Tells you whether or not there is currently ad inventory for the current page.|
|tldr.get_thumbnail_url()||string||Provides the URL for the preview image. Can be used to construct an image HTML tag.|
|tldr.get_title()||string||Provides the ad title.|
|tldr.get_caption()||string||Provides the ad caption text.|
|tldr.get_page_views()||int||Provides the ad page view count. This value is cached.|
|tldr.get_points()||int||Provides the ad point count. This value is cached.|
Ad Event Methods
These methods will record or handle user actions related to TLDR’s ad units.
|tldr.click( tldr.CLICK_TYPE )||null||This method records a user click action. The first argument must be from the CLICK_TYPE list below, denoting what type of user action the click is.|
|tldr.impression( tldr.IMPRESSION_TYPE )||null||This method records a user impression action. The first argument must be from the IMPRESSION_TYPE list below, denoting the type of impression the user experienced.|
The items listed here are properties of the tldr.IMPRESSION_TYPE object. They act as an enumeration for the tldr.impression method.
- fullpage – this is for the full page ad image.
- gallery – this is for an impression in the gallery. (Possibly not necessary)
- preview – this is for an impression of any preview link.
The items listed here are properties of the tldr.CLICK_TYPE object. They act as an enumeration for the tldr.click method.
- preview – this is for an click of any preview link.
- gallery – this is for an click in the gallery.
- upvote – if a user click on the upvote arrow.
- downvote – if a user clicks on a downvote arrow.
- comment – if a user makes a comment or caption
- fb_share – if a user click on the facebook share button
- twitter_share – if a user clicks on the twitter share button
- tumblr_share – if a user clicks on the tumblr share button
- reddit_share – you get the idea
- stumble_share – hopefully.
- email_share – almost there.
- other_share – if they click on the plus sign to expand out the sharing widget.
If you have any questions about the documentation, please contact todd at thoughtleadr.com OR join the ThoughtLeadr IRC channel at irc.wtower.net #thoughtleadr.