Pubblegum Javascript Documentation
Add the Pubblegum compact js file to the head of your html page. The size of this file is a humble 1k and can be hosted local. The code should look something like this:
<script type="text/javascript" src="code/adhese_pubblegum_compact.js"></script>
In the body of your page, create a Pubblegum object instance. You should pass three parameters to the constructor:
- accountID: the id (a string) of your Pubblegum account. You can find it on your personal profile page on http://app.pubblegum.com. If you do not have an account yet, please contact us.
- campaignID: A string you define that identifies this campaign. You can create new campaigns on http://app.pubblegum.com and define their id's.
- creativeID: A string you define that identifies this creative. Every new creativeID will automatically turn up in this campaign's report.
<script type="text/javascript"> var pubble = new Pubblegum( "accountID", "campaignID", "creativeID"); </script>
Creating the object will automatically log an impression for this page, including a reference to the url of the page, you don't have to call a function.
Optionally you can log clicks and actions. A click is a basic interaction, that will be logged and then redirect to the target page passed as parameter. When sending out banner ads, you can log clicks and pass a url as parameter.
<a href="javascript:pubble.clickR('http://www.pubblegum.com');"> register a click and jump to another site</a>
An action is used for logging an event in the creative. You can add a message to each action that will be reported on separately. You could for instance log when a user starts a stream.
pubble.action('player-start'); // will be reported as "creativeID-player-start"
pubble.action('player-stop'); // will be reported as "creativeID-player-stop"
