Skip to content

Campaign JavaScript Callbacks

JavaScript callbacks can be used to perform additional programmable actions based on the campaign’s state.

On Impression

The code will execute when the campaign is visible on the website.

On Event

The code will execute when the campaign is engaged in some way, such as clicking the submit button.

On Close

The code will execute when the campaign is closed by user action.

JavaScript Callbacks

Reporting to Google Analytics

You can add a custom code to apply additional logic for tracking the campaign’s performance and pushing it to the Google Analytics report.

On Impression

dataLayer.push({
event: 'interaction',
category: 'FLuentos Campaign',
action: 'Impression',
label: 'campaign-identifier',
})

On Event

dataLayer.push({
event: 'interaction',
category: 'FLuentos Campaign',
action: 'Click',
label: 'campaign-identifier',
})

On Close

dataLayer.push({
event: 'interaction',
category: 'FLuentos Campaign',
action: 'Close',
label: 'campaign-identifier',
})