Custom Data Options

Guide on passing custom data to Gumlet SDKs

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

Gumlet has divided custom data in three broad categories:

  • 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.

ParameterData TypeDescription
userIDStringUnique 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.
userNameStringFull name of the user.
userEMailStringEmail address with which the user signed up.
userPhoneStringContact Number of the user.
userProfileImageStringURL of the profile image of the user.
userProfileImageStringURL of the profile image of the user.
userAddressLine1StringAddress line one of the user.
userAddressLine2StringAddress line two of the user.
userCityStringCity of the user.
userStateStringState of the user.
userCountryStringCountry of the user.
userZipcodeStringZipcode 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

🚧

updateCustomUserData()

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 updateCustomUserData() to let Gumlet SDK know that it can start tracking the new data.
  gumletInsights.updateCustomUserData({
		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 updateCustomUserData() 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.

ParameterData TypeDescription
customContentTypeStringThe type of content in the video playback. (e.g. 'short', 'movie', 'episode', 'clip', 'trailer', or 'event').
customVideoDurationMillisIntegerThis 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
customEncodingVariantStringAn optional detail that allows you to compare different encoding settings.
customVideoLanguageStringThe audio language of the video, assuming it's unchangeable after playing.
customVideoIdStringYour internal ID for the video

Can be the primary key in the projects database to uniquely identify this video.
customVideoSeriesStringThis parameter is used to check metrics on a group of videos such as a series or a season.

example: 'Season 1'
customVideoProducerStringThe producer of the video title
customVideoTitleStringThe title of the video.
customVideoVariantStringA 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
customVideoVariantNameStringA 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.

🚧

updateCustomVideoData()

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.updateCustomVideoData({
    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 updateCustomVideoData() 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.

ParameterData TypeDescription
customPlayerIntegrationVersionStringAs 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.
customPlayerNameStringIdentifies different configurations or types of players around your site or application.
customPageTypeStringProvides 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.

ParameterData Type
customData1String
customData2String
customData3String
customData4String
customData5String
customData6String
customData7String
customData8String
customData9String
customData10String
<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.
		customData1   : '',
		customData2   : '',
		customData3   : '',
		customData4   : '',
		customData5   : '',
		customData6   : '',
		customData7   : '',
		customData8   : '',
		customData9   : '',
		customData10  : ''
  };

  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.
		customData1   : '',
		customData2   : '',
		customData3   : '',
		customData4   : '',
		customData5   : '',
		customData6   : '',
		customData7   : '',
		customData8   : '',
		customData9   : '',
		customData10  : ''
  };

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

  gumletInsights.updateCustomData({
		customData1   : '',
		customData2   : '',
		customData3   : '',
		customData4   : '',
		customData5   : '',
		customData6   : '',
		customData7   : '',
		customData8   : '',
		customData9   : '',
		customData10  : ''
  });	
</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>