Home / Admin / om-js-events-ga-impression.js
Duplicate Snippet

Embed Snippet on Your Site

om-js-events-ga-impression.js

Code Preview
js
// OptinMonster Javascript Event for Google Analytics Impression Event
document.addEventListener( 'om.GoogleAnalytics.preImpressionEvent', function( event ) {
	var ga = event.detail.GoogleAnalytics;
	var campaign = event.detail.Campaign;
	var gaEvent = event.detail.gaEvent;
	if ( 'YOUR_CAMPAIGN_ID' !== campaign.id ) {
		return;
	}
	// custom code goes here
	gaEvent.name = 'my_custom_impression_event_name';
	gaEvent.params.my_custom_param = 'my_custom_value';
} );

Comments

Add a Comment