Skip to main content


How to use Google Analytics as analytical solution

Since Google Analytics relies on cookie as storage by default. Using Google Analytics with default setting will hit cross-site cookie limitation on latest mobile browsers, as Link Game Platform will sandbox game content in a sandbox domain for enhanced privacy and security control.

Here describes a recommended way of using Google Analytics in Link Game Platform.

Installing analytics.js

In your index.html, append this snippet right after the SDK <script> element.

<!-- Google Analytics -->
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
<!-- End Google Analytics -->

Creating Tracker When SDK is Initialized

ga('create','UA-XXXXXXXX-YY',{ // Replace UA-XXXXXXXX-YY with your tracking ID
'storage':'none', // Disable using cookie for GA storage
'clientId':LinkGame.player.getID(), // Use player ID as identifier

Recording Page View

ga('send','pageview'); // Record a page view with current URL

For more advanced tracking use case, please refer to analytics.js documentations.

Note on Google Tag Manager

Unfortunately Google Tag Manager is not providing an obvious way to configure the storage option for Google Analytics tag. So if you have to use Google Tag Manager, you need to create Custom HTML tag with the snippet provided above instead of the Google Analytics tags.