Campaign JavaScript Callbacks
JavaScript callbacks run your own code when something happens in the campaign. You find them under JavaScript Callbacks on the campaign’s Publish tab. A developer usually writes the code.
On Impression
Section titled “On Impression”Runs your JavaScript when the campaign shows.
On Submit
Section titled “On Submit”Runs your JavaScript each time a visitor submits a step of the campaign, and when a visitor presses a button set to count as a conversion (Counts As on the Button component).
On Close
Section titled “On Close”Runs your JavaScript when the campaign closes: its close button, a button set to close, an automatic close or an opened link. It does not run when the visitor leaves the page.
On Click
Section titled “On Click”Runs your JavaScript each time a visitor clicks a button that opens a link, and when they start a game.
Reporting to Google Analytics
Section titled “Reporting to Google Analytics”To see campaign activity in Google Analytics, push an event to the data layer from each callback. Replace campaign-identifier with a name for the campaign.
On Impression
Section titled “On Impression”dataLayer.push({ event: 'interaction', category: 'Fluentos Campaign', action: 'Impression', label: 'campaign-identifier',})On Submit
Section titled “On Submit”dataLayer.push({ event: 'interaction', category: 'Fluentos Campaign', action: 'Submit', label: 'campaign-identifier',})On Close
Section titled “On Close”dataLayer.push({ event: 'interaction', category: 'Fluentos Campaign', action: 'Close', label: 'campaign-identifier',})