Custom Data Options

Gumlet Insights SDK allows you to pass custom data parameters when initialising the SDK. This data is available on the dashboard break downs.
This makes it easier to track and get insights/perfomance at a single user level.

Gumlet has divided custom data in three broad categories viz

  • User Data
  • Video Data
  • Player Data

User Data

Gumlet Insights SDK allows you to pass user data which is stored in the projects main database to allow analysis at user level.

The following custom parameters can be passed while building the configuration to initialise the SDK.

There is an option to update this data via a function call while the SDK is already initialised with some user data.

Parameter

Data Type

Description

userID

String

Unique ID is used to identify the user in the primary database of the project. This variable is used to map data on the dashboard to the user data in the database.

You can use the primary key of the table for this field.

userName

String

Full name of the user.

userEMail

String

Email address with which the user signed up.

userPhone

String

Contact Number of the user.

userProfileImage

String

URL of the profile image of the user.

userProfileImage

String

URL of the profile image of the user.

userAddressLine1

String

Address line one of the user.

userAddressLine2

String

Address line two of the user.

userCity

String

City of the user.

userState

String

State of the user.

userCountry

String

Country of the user.

userZipcode

String

Zipcode of the user.

You can pass this data while initialising the SDK

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        userId            : '123',
        userName          : 'Océane Bourgeois',
        userEMail         : '[email protected]',
        userPhone         : '(840)-295-4133',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        userId            : '123',
        userName          : 'Océane Bourgeois',
        userEMail         : '[email protected]',
        userPhone         : '(840)-295-4133',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});
    
</script>

To update the user data use the following code snippet

🚧

updateCutomUserData()

The function resets the existing data for the variables mentioned above. If no data is passed then the data is set as empty.

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        userId            : '123',
        userName          : 'Océane Bourgeois',
        userEMail         : '[email protected]',
        userPhone         : '(840)-295-4133',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);

  // if the user updates their data we can call the updateCutomUserData() to let Gumlet SDK know that it can start tracking the new data.
  gumletInsights.updateCutomUserData({
        userId            : '123',
        userName          : 'Christelle Robert',
        userEMail         : '[email protected]',
        userPhone         : '(078)-380-95-96',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  });
    
  // When the updateCutomUserData() is called it sets all the user related custom 
  // parameters as empty if the value for a paramter hasn't changed, it still needs to be passed.
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        userId            : '123',
        userName          : 'Océane Bourgeois',
        userEMail         : '[email protected]',
        userPhone         : '(840)-295-4133',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});

    // if the user updates their data we can call the updateCutomUserData() to let Gumlet SDK know that it can start tracking the new data.
  gumletInsights.updateCutomUserData({
        userId            : '123',
        userName          : 'Christelle Robert',
        userEMail         : '[email protected]',
        userPhone         : '(078)-380-95-96',
        userProfileImage  : 'https://assets.gumlet.io/assets/gumlet-logo-white-font.png?w=240&format=auto',
        userAddressLine1  : '8774, Rue de la Mairie',
        userAddressLine2  : '',
        userCity          : 'Reims',
        userState         : 'Landes',
        userCountry       : 'France',
        userZipcode       : '83894',
  });
    
  // When the updateCutomUserData() is called it sets all the user related custom 
  // parameters as empty if the value for a paramter hasn't changed, it still needs to be passed.
    
</script>

Video Data

The following custom parameters are accepted by the SDK as attributes to the video currently playing. Each parameter is optional.

Parameter

Data Type

Description

customContentType

String

The type of content in the video playback. (e.g. 'short', 'movie', 'episode', 'clip', 'trailer', or 'event').

customVideoDurationMillis

Integer

This parameter can be used as a custom video duration. Gumlet SDK automatically tracks the total video playback duration but this parameter can be used to have an additional and custom video duration.

The value should be in milliseconds.
Example if the video is of 30 seconds then the value should be 30000, if the total video playback duration is 1 minute 20 seconds then the value should be 80000

customEncodingVariant

String

An optional detail that allows you to compare different encoding settings.

customVideoLanguage

String

The audio language of the video, assuming it's unchangeable after playing.

customVideoId

String

Your internal ID for the video

Can be the primary key in the projects database to uniquely identify this video.

customVideoSeries

String

This parameter is used to check metrics on a group of videos such as a series or a season.

example: 'Season 1'

customVideoProducer

String

The producer of the video title

customVideoTitle

String

The title of the video.

customVideoVariant

String

A custom video variant ID i.e. if there are multiple variants of the same video then this parameter can be used to track issues or metrics of different versions.

Example hard coded subtitles in the videos

customVideoVariantName

String

A recognisable name for the video variant to easily identify the video.

You can pass this data while initialising the SDK

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customContentType             : 'episode',
        customVideoDurationMillis     : 2600000, // 43 minutes 20 seconds
        customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
        customVideoId                 : 'HIMYMSeason1Episode1',
        customVideoSeries             : 'HIMYMSeason1',
        customVideoProducer           : 'Ece Tekelioglu',
        customVideoTitle              : 'Pilot',
        customVideoVariantName        : '',
        customVideoVariant            : '',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customContentType             : 'episode',
        customVideoDurationMillis     : 2600000, // 43 minutes 20 seconds
        customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
        customVideoId                 : 'HIMYMSeason1Episode1',
        customVideoSeries             : 'HIMYMSeason1',
        customVideoProducer           : 'Ece Tekelioglu',
        customVideoTitle              : 'Pilot',
        customVideoVariantName        : '',
        customVideoVariant            : '',
  };
    
  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});
    
</script>

To update video data use the following code snippet.

🚧

updateCutomVideoData()

The function resets the existing data for the variables mentioned above. If no data is passed then the data is set as empty.

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customContentType             : 'episode',
        customVideoDurationMillis     : 2600000, // 43 minutes 20 seconds
        customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
        customVideoId                 : 'HIMYMSeason1Episode1',
        customVideoSeries             : 'HIMYMSeason1',
        customVideoProducer           : 'Ece Tekelioglu',
        customVideoTitle              : 'Pilot',
        customVideoVariantName        : '',
        customVideoVariant            : '',
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);
    
    gumletInsights.updateCutomVideoData({
    customContentType             : 'episode',
      customVideoDurationMillis     : 2405000, // 40 minutes 5 seconds
      customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
      customVideoId                 : 'HIMYMSeason1Episode2',
      customVideoSeries             : 'HIMYMSeason1',
      customVideoProducer           : 'Ece Tekelioglu',
      customVideoTitle              : 'Episode2',
      customVideoVariantName        : '',
      customVideoVariant            : '',
  })    
    
    // When the updateCutomVideoData() is called it sets all the video related custom 
    // parameters as empty if the value for a paramter hasn't changed, it still needs to be passed.
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  var gumletConfig = {
        property_id       : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customContentType             : 'episode',
        customVideoDurationMillis     : 2600000, // 43 minutes 20 seconds
        customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
        customVideoId                 : 'HIMYMSeason1Episode1',
        customVideoSeries             : 'HIMYMSeason1',
        customVideoProducer           : 'Ece Tekelioglu',
        customVideoTitle              : 'Pilot',
        customVideoVariantName        : '',
        customVideoVariant            : '',
  };
    
  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});
    
    gumletInsights.updateCutomVideoData({
    customContentType             : 'episode',
      customVideoDurationMillis     : 2405000, // 40 minutes 5 seconds
      customEncodingVariant         : 'test1',
        customVideoLanguage           : 'English',
      customVideoId                 : 'HIMYMSeason1Episode2',
      customVideoSeries             : 'HIMYMSeason1',
      customVideoProducer           : 'Ece Tekelioglu',
      customVideoTitle              : 'Episode2',
      customVideoVariantName        : '',
      customVideoVariant            : '',
  })    
    
    // When the updateCutomVideoData() is called it sets all the video related custom 
    // parameters as empty if the value for a paramter hasn't changed, it still needs to be passed.
</script>

Player Data

These custom parameters are specific to the player integration. These parameters are useful when trying to debug/detect issues related to major changes in player configurations.

Parameter

Data Type

Description

customPlayerIntegrationVersion

String

As you make changes to your player you can compare how new versions of your player perform by updating this value. This is not the player software version (e.g. Video.js 5.0.0), which is tracked automatically by the SDK.

customPlayerName

String

Identifies different configurations or types of players around your site or application.

customPageType

String

Provides the context of the page for more specific analysis. Values include 'watchpage' or 'iframe'

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  // Build the current configuration for the SDK to be initialised.
  var gumletConfig = {
        property_id                     : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customPlayerIntegrationVersion  : 'v1.1',
        customPlayerName                : 'Trailer',
        customPageType                  : 'Homepage'
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  var gumletConfig = {
        property_id                     : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        customPlayerIntegrationVersion  : 'v1.1',
        customPlayerName                : 'Trailer',
        customPageType                  : 'Homepage'
  };
    
  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});
    
</script>

More optional data

These parameters are additional data points which can be used to a particular use case for an application. The values in these parameters can be anything which needs to be tracked.

Each parameter supports alphanumeric values.

❗️

Keep the definitions for each parameter same throughout the SDK implementation.

Parameter

Data Type

customData1

String

customData2

String

customData3

String

customData4

String

customData5

String

customData6

String

customData7

String

customData8

String

customData9

String

customData10

String

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  var gumletConfig = {
        property_id  : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  var gumletConfig = {
        property_id  : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  };
    
  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});
    
</script>

🚧

updateCustomData()

The function resets the existing data for the variables mentioned above. If no data is passed then the data is set as empty.

<script src="/path/to/video.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

<script type="text/javascript">

  var playerOptions = {
        preload: false
  };
  var player = videojs('my-video', playerOptions);

  var gumletConfig = {
        property_id  : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  };

  var gumletInsights = gumlet.insights(gumletConfig);
  gumletInsights.register(player);

  gumletInsights.updateCustomData({
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  });   
</script>
<script src="/path/to/hls.js"></script>

<script src="https://cdn.gumlytics.com/insights/1.0/gumlet-insights.min.js"></script>

script type="text/javascript">

  var video = document.getElementById('my-video');
  var time = new Date().getTime();
  var hls = new Hls({
        // disable preload
        autoStartLoad: false
  });

  hls.attachMedia(video);
  hls.loadSource('<VIDEO URL>');
  video.addEventListener('play', function() {
        // needed for when preload disabled
        hls.startLoad();
  });

  var gumletConfig = {
        property_id  : 'PROPERTY_ID_GOES_HERE', // required:  please replace with correct property id.
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  };
    
  var gumletInsights = gumlet.insights(gumletConfig);
  analytics.register(hls, {starttime: time});

  gumletInsights.updateCustomData({
        cutomData1   : '',
        cutomData2   : '',
        cutomData3   : '',
        cutomData4   : '',
        cutomData5   : '',
        cutomData6   : '',
        cutomData7   : '',
        cutomData8   : '',
        cutomData9   : '',
        cutomData10  : ''
  });
    
</script>

Did this page help you?