#Configuration
While the default configuration works for most use cases, you might want to
configure some of Engage.js
behaviors.
ℹ️ Your Dashboard configuration will override these configuration values unless
they have been set with a read-only mode.
#Usage
.config(optionName: String, optionValue: Any, readOnly?: Boolean): Engage
.config(options: Object, readOnly?: Boolean): Engage
index.js
const engage = Engage.init('<your app id>');
engage.config({ debug: true });
engage.config('debug', true, true);
engage.config('debug', true);
engage.config({
debug: true,
});
engage.config({
debug: true,
}, true);
#Options
#debug
- Type: Boolean
- Default: false
When debug mode is enabled, Engage.js will log everything it does in the browser console.
Example
engage.config('debug', true);
#autoPageViews
- Type: Boolean
- Default: true
When autoPageViews is enabled, Engage.js will automatically increment the page views counter on every page load (front-end applications using virtual routing should commit pageviews using .commitPageView()
).
Example
engage.config('autoPageViews', true);
#stripePublicKey
- Type: String
- Default: null
Used to enable Stripe credit card form fields inside elements.
Example
engage.config('stripePublicKey', 'pk_live_12345');
#locale
- Type: String
- Default: 'en'
The locale used by default texts inside elements.
Example
engage.config('locale', 'fr');
#pianoAutoTrackingEnabled
- Type: Boolean
- Default: false
Enable/disable automatic Piano tracking for particular events.
⚠️ Piano SDK integration required, i.e using pa()
tracking method.
Example
engage.config('pianoAutoTrackingEnabled', true);
#gtagAutoTrackingEnabled
- Type: Boolean
- Default: false
Enable/disable automatic Google Analytics 4 tracking (Google Analytics 4 tag required) for particular events.
⚠️ Google Analytics 4 integration required, i.e using gtag()
tracking method.
Example
engage.config('gtagAutoTrackingEnabled', true);