Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

Code Block
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:

Code Block
languagejs
nt('send', 'event', {
  eventCategory: 'Remarketing',
  eventAction: 'purchase',
  eventLabel: '$50.34'
});
Code Block
languagejs
nt('send', 'event', {
  eventCategory: 'Engagement',
  eventAction: 'page viewed',
  eventLabel: 'Discounts page'
});
Code Block
languagejs
nt('send', 'event', {
  eventCategory: 'Engagement',
  eventAction: 'Scroll',
  eventLabel: 'half page scrolled'
});
Code Block
languagejs
nt('send', 'event', {
  eventCategory: 'Engagement',
  eventAction: 'Video view',
  eventLabel: '20 seconds viewed'
});

...

languagejs

...

The article is now available here: https://n.rich/en/knowledge-base/event-tracking-sending-in-page-events-to-analytics