The init method is used to create a new instances of the Gamesight Web SDK and to configure some base settings. Below is the standard initialization call for the Web SDK.

(G.gsght.q=G.gsght.q||[]).push(arguments)},G.gsght.q=[],G.gsght.h=1*new Date();
gsght('init', 'GS-XXXXXX')

The full method signature for initialize is the following:

gsght('init', '{web_api_key}', '[{platform}]', '[{instance_name}]')








The Web API Key for this instance of the SDK. More details in the Web Measurement SDK Quick Start


String (optional)

'web' (default)

The platform value to use for this instance - see Identifiers for a full list of platform values


String (optional)


The optional name for this instance, see the Using Named Instances below for more details

Using Named Instances

If you would like to have multiple instances of the Web SDK on a single page you can utilize the named instances feature. This allows you to create and reference multiple instances by a unique name so they can be managed independently. The below example shows how you can utilize named instances.

// initialize 2 named instances 
gsght('init', 'web_api_key', 'web', 'my_name')
gsght('init', 'web_api_key2', 'web', 'my_other_name')

// specify the name in the command separated by a period (.) 
gsght('my_name.set', 'user_id', [...])
gsght('my_name.send', 'event_name', {...})
gsght('my_other_name.send', 'event_name', {...})