Web Measurement SDK Quick Start

Gamesight's Web SDK enables many different flows to be measured effectively.

  • Attribution for web-based games
  • Tracking for pre-install events such as web form signups
  • Attaching known User IDs to user's device for deterministic matching

Step 1. Generate an API Key

A valid API key is required before you will be able to use Gamesight from your game. API keys can be generated through the "Management" tab on the Gamesight dashboard under the In-Game Integration option.

If you do not have access to this page please contact an Admin for you Game so they can grant you the "Game Integrator" permissions.

Step 2. Insert JS Snippet

Before you will be able to start working with the Gamesight Web SDK you need to insert the JavaScript snippet. The string 'GS-XXXXXX' should be replaced with the Web SDK ID from the "In-Game Integration" section of your Gamesight Management page.

<script>
// Gamesight SDK Snippet
(function(G,m,s,g,h,t){G.gsght=G.gsght||function(){
(G.gsght.q=G.gsght.q||[]).push(arguments)},G.gsght.q=[],G.gsght.h=1*new Date();
h=m.createElement(s),t=m.getElementsByTagName(s)[0];h.async=1;h.src=g;t.parentNode.insertBefore(h,t)
})(window,document,'script','https://cdn.gsght.com/sdk.js');
  
gsght('init', 'GS-XXXXXX');
</script>

Step 3. Specify User IDs

One of the most important fields in the Measurement API is the user_id value. By providing Gamesight with a unique User ID for each player we can provide:

  • More accurate reporting by preventing "double counting" of game sales
  • Enable your BI team to tag users in your data warehouse based on their attributed referral source
  • Advanced reports on user journeys and flows from web to game client and back
  • Improved debugging experiences and visibility into the event stream

Requirements

Here are some important considerations when selecting your User ID value:

Unique - Each user must get a unique User ID

Consistent - The User ID must be consistent between game sessions

Meaningful - The ID should be a value that can be related back to other metrics your BI team is already recording internally.

Private - To protect users it is important that the User ID value is not personally identifiable to people outside of your company. This means avoiding public identifiers like email addresses or usernames.

To meet these requirements we recommend that you use some for of internal Account ID. In the past we have seen success with values such as uniquely hashed Steam IDs, or game-specific account ids, or UUIDs that are associated with in-game accounts through a lookup table.

External IDs

Providing external IDs enables deterministic matching for various use cases. Specifically for console or cross device attribution, providing reliable external IDs provides deterministic values for attribution to be run against.

gsght('set', 'user_id', [
  // REQUIRED for Events: use this id type for your in-game user id
  {type: 'user_id', id: 'in_game_user_id'},

  // Optional: Link external game ids for things like company-wide accounts
  {type: 'MY_ID_TYPE', id: 'my_own_network_id', scope_type:'company', scope_id:'My Company'},
])

Step 4. Send Events

Simply call the send method each time you wish to record an event and Gamesight will handle the rest!

gsght('send', 'game_launch');

Step 5. User Notice

🚧

User Privacy Notice

The following section is not legal advice. Please consult with your company's legal counsel to determine the best approach for your company and players.

We recommend that you provide your users with either notice of the integration or some control over whether metrics collection is enabled in-game. While not legally required given the nature of the data shared, many gamers are more comfortable having control over the metrics their game sends to third parties.

The do not track list feature in the Gamesight console can be used as a fallback to block data collection on users when an in-game opt-out solution isn't viable. Right to access and data removal requests can be handled via our GDPR APIs.

Step 6. All Done!

That's it! You have now integrated the Gamesight Web SDK into your web property. For more integrations check out our complete reference.


For more information, or help integrating Gamesight, contact us through live chat (on the right side of the page) or email us at [email protected]


Did this page help you?