.noConflict(): Engage#Methods
#Global methods
#noConflict
If an
Engage object already exists in the global object of the current
page, the Engage.js library will be renamed to PooolEngage and the original
Engage object will be restored.#init
.init(appId: String): EngageCreates a new Engage instance (required to display elements) using your app ID.
#createElement
.createElement(slug: String, target: String | Node, params?: { filters?: String[] }): Promise<EngageElement>Creates a new Element instance.
#autoCreate
.autoCreate(opts?: { filters?: Array<String> }): Promise<Array<EngageElement>>Creates all elements matching multiple conditions like device, country, custom filters, etc.
#commitPageView
.commitPageView(): EngageIncrement the page view counter in the browser's localStorage for elements with a page view count limit.
You can also use this to base capping on sessions instead of page views:
#config
.config(optionName: String, optionValue: Any, readOnly?: Boolean): Engage.config(options: Object, readOnly?: Boolean): EngageAllows to set some configuration options. See the
configuration options documentation.
#texts
.texts(keyName: String, text: String, readOnly?: Boolean, locale?: String): Engage.texts(options: Object, readOnly?: Boolean, locale?: String): EngageAllows to override some hard coded texts. See the
texts documentation.
#variables
.variable(name: String, value: Any): Engage.variable(options: Object): EngageAllows to set custom variables to be replaced inside some text keys. See the
variables documentation.
#on
.on(name: String, callback: Function, opts?: { once?: Boolean }): EngageAllows to set a callback to be called when a specific event is triggered. See
the events documentation.
#off
.off(name: String, callback: Function): EngageAllows to remove an event callback previously set with
.on().#Element methods
#destroy
.destroy(): Promise<void>Destroys the element.