Sending in-page events to analytics

You can launch in-page events with N.rich Website Tag. After installing the Tag the nt function can be used to emit custom events. This function will be available on any page including N.Rich Website Tag and may be called anywhere on the page once the page has loaded.

The function supports three parameters: eventCategory, eventAction and eventLabel in the configuration object and the values of the parameters may be defined by the user. Any other parameters will be omitted. Example:

1 2 3 4 5 nt('send', 'event', { eventCategory: 'Outbound Link', eventAction: 'click', eventLabel: 'advertising click' });

eventCategory, eventAction and eventLabel can be any string value, but there is some limitations:

  • eventCategory and eventLabel will be trimmed to 75 characters if exceeded, bounding spaces will be removed.

  • eventAction will be trimmed to 50 characters if exceeded, bounding spaces will be removed.

Every the time function will be called it will generate a new event in the statistics. The event will be saved within N.Rich analytics system to the table main_stats_final_v6 with event_name='PAGE_EVENT' and can be used in the various dashboards.

Examples of events:

1 2 3 4 5 nt('send', 'event', { eventCategory: 'Remarketing', eventAction: 'purchase', eventLabel: '$50.34' });
1 2 3 4 5 nt('send', 'event', { eventCategory: 'Engagement', eventAction: 'page viewed', eventLabel: 'Discounts page' });
1 2 3 4 5 nt('send', 'event', { eventCategory: 'Engagement', eventAction: 'Scroll', eventLabel: 'half page scrolled' });
1 2 3 4 5 nt('send', 'event', { eventCategory: 'Engagement', eventAction: 'Video view', eventLabel: '20 seconds viewed' });
1 2 3 4 5 nt('send', 'event', { eventCategory: 'Link action', eventAction: 'click', eventLabel: 'Ref to buy clicked' });