Documentation

AP

Methods

fireEvent(id, props)

fire an analytics event

Parameters:
Name Type Description
id

the event id. Will be prepended with the prefix "p3.iframe."

props

the event properties

This functionality is deprecated and may be removed in the future.

getLocation(callback)

get the location of the host page

Parameters:
Name Type Description
callback function

function (location) {...}

Example
AP.getLocation(function(location){
  alert(location); 
});

getTimeZone(callback)

get current timezone - if user is logged in then this will retrieve user's timezone the default (application/server) timezone will be used for unauthorized user

Parameters:
Name Type Description
callback function

function (user) {...}

Example
AP.getTimeZone(function(timezone){
  console.log(timezone);
});

getUser(callback)

get a user object containing the user's id and full name

Parameters:
Name Type Description
callback function

function (user) {...}

Example
AP.getUser(function(user){ 
  console.log(user);
});

resize(width, height)

resize this iframe

Parameters:
Name Type Description
width String

the desired width

height String

the desired height