events (knowledge graph)


Apply custom events triggered on Knowledge Graph widget during the life-cycle:

  • nav - Fired when request to web service is done; Invoked with arguments: event, box, url and type, where type is a navigation action and can be:

    • go - navigate to Knowledge Graph entity

    • rel - click on category of entity

    • tab - select a relationship

    • prev, next - paginate to previous/next page in list view

    • page - paginate to specific page number in list view

    • external - navigate to entity URL

    • share - click on a share tool

  • render - Fired when view is rendered; Invoked with arguments: event, box, url and data, where data is processed output from Knowledge Graph endpoint.

All events will receive the below parameters:

  • event - JavaScript Event object

  • box - configuration of Knowledge Graph widget

  • url - current Knowledge Graph API endpoint

Default value

events: null


Enable tracking

events parameter can be used to enable third-party tracking of endpoint clicks in Knowledge Graph widget.

Basic setting of google analytics

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', '<googla-analytics-ID>', 'auto');
  ga('send', 'pageview');

<script type="text/javascript">
  jQuery(document).ready(function() {
      events: {
        nav: function(event, box, url, type) {
          ga('send', 'event', {eventCategory: type, eventAction: url});

Friendly display setting

events: {
  nav: function(event, box, url, type) {
    const t = {
      go: 'View entity',
      rel: 'View relationships',
      tab: 'Filter relationships',
      prev: 'Click on previous in pagination',
      next: 'Click on next in pagination',
      page: 'Click on page number in pagination',
      external: 'Open entity',
      share: 'Share entity'};
    ga('send', 'event', { eventCategory: 'Funnelback Knowledge Graph', eventAction: t[type] || type, eventLabel: url });