The methods below are available on any page that loads the Remarketing code above.
_nzm_config['no_tracking'] = 1;_nzm.setTracking(0);Sets a cookie of the form _nzm_tr_10200-1 with the value 0. It can be called from the logic of a "cookie banner".
_nzm.setTracking(1);Deletes the cookie of the form _nzm_tr_10200-1. It can be called from the logic of a "cookie banner".
_nzm.identify( { email: 'ion@company.com', first_name: 'John', last_name: 'Doe' } );or
_nzm.identify( { email: 'ion@company.com'} );This usually happens after a user logs in to your application.
For special cases, you have to specify the email field whose value is used for autoidentify. The code goes into the Newsman administration interface, under "Settings" > "Remarketing". You can specify either the selector alone, or the selector and the page on which the selector should be looked up.
_nzm_config['autoidentify'].push({'url_containing': '/contul-meu', 'email_selector': '#ctl10_UserName'});
_nzm_config['autoidentify'].push({'url_containing': '/cosul-meu/comanda-rapida', 'email_selector': '#ctl10_tbEmail'});_nzm_config['autoidentify'].push({'email_selector': '#ctl10_UserName'});
_nzm_config['autoidentify'].push({'email_selector': '#ctl10_tbEmail'});_nzm_config['enable_nonidentified'] = 1;_nzm_config['subscribe_checkbox'].push({'url_containing': '/contul-meu', 'checkbox_selector': '#opt-in-newsletter'});
_nzm_config['subscribe_checkbox'].push({'url_containing': '/cosul-meu/comanda-rapida', 'checkbox_selector': '#opt-in-newsletter-2'});or
_nzm_config['subscribe_checkbox'].push({'checkbox_selector': '#opt-in-newsletter'});
_nzm_config['subscribe_checkbox'].push({'checkbox_selector': '#opt-in-newsletter-2'});_nzm.get_tracking_id();_nzm.run( 'user:setProp', { 'skill': 3000 } );function my_callback(param) {
console.log("This is a callback");
}
_nzm.track('good_luck', { luck_level: 10 }, 'my_callback');
_nzm.track('good_luck', { luck_level: 10 });_nzm.run('modal:show');
_nzm.run('modal:hide');The modal can also be displayed embedded in a DOM node on demand: <div class="show-here-class">modal</div>
_nzm.run('modal:show', '.show-here-class');<div id="show-here-id">modal</div>
_nzm.run('modal:show', '#show-here-id');
_nzm.run('modal:show', '#show-here-id', 'insert');
_nzm.run('modal:show', '#show-here-id', 'append');
_nzm.run('modal:show', '#show-here-id', 'replace');
_nzm.run('modal:show', '#show-here-id', 'insert_before');
_nzm.run('modal:show', '#show-here-id', 'insert_after');A specific modal can be displayed, by form_id:
_nzm.run('modal:show:1c2c635b96eeeb3e8ee4756vc6c889163f2', '#show-here-id', 'insert_before');on:scrollon:scroll.upon:scroll.downon:scroll.toTopon:scroll.toBottomon:scroll.to25on:scroll.to50on:scroll.to75on:unloadon:seconds-passed_nzm.run('on:scroll.to50', function () { console.log('Scrolled to mid page') } );
_nzm.run('on:seconds-passed', function () { console.log('It passed 5 seconds after page loaded') }, 5);_nzm.run( 'send', 'event', 'UX', 'click', 'add to cart', null, _nzm.createFunctionWithTimeout(function() {
console.log('Produsul a fost pus in cos')
}));Use this method when a redirect happens immediately after the tracking call (for example: add to cart with a redirect to the cart). If _nzm.run does not work, the callback still runs (it has a one second timeout).
_nzm.debug();The ecommerce module is very similar to Google's Enhanced Ecommerce. The fastest way to integrate Newsman Remarketing for ecommerce with your applications is therefore to clone your Google Enhanced Ecommerce integration, if you already have one: change the loading script and replace "ga(" with "_nzm.run(" in the code.
The following sections show how to implement and measure these activities:
_nzm.run( 'require', 'ec' );_nzm.run( 'set', 'currencyCode', 'RON' );_nzm.run( 'require', 'ec');
_nzm.run( 'set', 'currencyCode', 'USD' );
_nzm.run( 'ec:addProduct', {
'id': 'S-003',
'name': 'Elkton Jacket',
'category': 'Longsleeves/Men\'s Clothing/Other/Pants/T-shirts',
'price': '249',
} );
_nzm.run( 'ec:setAction', 'detail' );
_nzm.run( 'send', 'pageview' );_nzm.run( 'require', 'ec' );
_nzm.run( 'set', 'currencyCode', 'EUR' );
_nzm.run( 'ec:addImpression', {
'id': '266',
'name': 'Spencer Cadet',
'category': 'Climbing Equipment',
'list': 'Product List',
'position': '1'
} );
_nzm.run( 'ec:addImpression', {
'id': '259',
'name': 'E.C.O. Yoga Mat',
'category': 'Climbing Equipment',
'list': 'Product List',
'position': '2'
} );
_nzm.run( 'send', 'pageview' );_nzm.run( 'require', 'ec');
_nzm.run( 'set', 'currencyCode', 'RON' );
_nzm.run( 'ec:addProduct', {
'id': '035pp',
'name': 'Pantalonis Trouser',
'price': '44.11',
'brand': 'Pantalonis',
'category': 'Trousers',
'quantity': 1
} );
_nzm.run( 'ec:setAction', 'add' );
_nzm.run( 'send', 'event', 'UX', 'click', 'add to cart' );_nzm.run( 'require', 'ec');
_nzm.run( 'set', 'currencyCode', 'RON' );
_nzm.run( 'ec:addProduct', {
'id': '035pp',
'quantity': '1',
} );
_nzm.run( 'ec:setAction', 'remove' );
_nzm.run( 'send', 'event', 'UX', 'click', 'remove from cart' );_nzm.run( 'require', 'ec');
_nzm.run( 'set', 'currencyCode', 'RON' );
_nzm.run( 'ec:addProduct', {
'id': 'T-03',
'name': 'Spencer Cadet',
'category': 'Climbing Equipment',
'price': '84.00',
'quantity': '1'
} );
_nzm.run( 'ec:setAction', 'purchase', {
'id': '758',
'affiliation': 'RetroMod',
'revenue': '84.00',
'tax': '0',
'shipping': '4.00'
} );
_nzm.run('send', 'pageview');The articles below are also worth reading: