Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The ONEcount SDK is available from the main javascript widget that is loaded on the client site all.min. Using the  SDK, developers can interact with the platform as well as hooking into events. All of the code necessary for running the Javascript SDK is loaded through all.min.js.

Methods

  • GCN.onecount.login(brand): If the user is not already logged in, this will take the user to the login page.
    • brand: optional parameter that specifies with brand to user on the login page.
  • GCN.onecount.logout(): Log a user out of ONEcount if the user is logged in.
  • GCN.onecount.isLoggedIn(): Check whether a user is logged in or not. Return a boolean true/false
  • GCN.onecount.setTargeting(): Load the targeting rules if any
  • GCN.onecount.custom_data(identifier, value, callback): Collects custom data provided by clients.
    • identifier: the unique identifier for that type of data
    • value: the value we're collecting. This must be a JSON string ('{"foo" : "bar"}')
    • callback: the callback function to call. A object will be sent as a parameter with the value {"success":true} for successful and {"success":false} for unsuccessful.
  • GCN.onecount.track(url, title, referrer, resourceId, callback): By default, ONEcount widgets track impressions on each page load. For sites where one article is displayed per page, this works fine. But in cases where articles are displayed on the same page, i.e. infinite scroll, only the first one is tracked.

...