h5-azerion-branding
This library is a simpeler version of the Splash screen, with no attachment to Phaser. This means that there is no splash, only utilities and image URL's
Branding
The most important part of this lib, as the name suggests, is the branding part. In order to have the branding (and the utilities for that matter) work correctly, you need to preload some files first.
This library can handle this framework agnostic and the only thing you have to do is the following during your game's load setup:
h5branding.Branding.preload('version-for-cachebusting');
After this there are 3 main method you'll probably use a lot and some helpers that might be used occasionally.
The main 3 methods are:
h5branding.Branding.brandingLogoUrl();
h5branding.Branding.openCampaignLink('my-game-name', h5branding.UtmTargets.more_games);
h5branding.Branding.outGoingLinksAllowed();
Apart from these there are some individual helper methods that allow you to check for individual platforms/portals:
h5branding.Branding.isInternal();
h5branding.Branding.isContracted();
h5branding.Branding.isSpecial();
h5branding.Branding.isAdmeen();
h5branding.Branding.isKongregate();
h5branding.Branding.isNewgrounds();
h5branding.Branding.isBild();
h5branding.Branding.isBip();
h5branding.Branding.isPlaycellApp();
h5branding.Branding.isSpil();
h5branding.Branding.isAirfi();
Utilities
The utilities part is mostly used as simple helpers for the Branding part, but also includes some tiny other pieces of code that might be helpfull.
Let's start with the domain checking, in essence these are some helper parts that will allow you to filter the domain from which the game is called from.
This can either be a direct call (apps / gd / partners like yandex), or an iframe call (anyn other inclusion :D).
h5branding.Utils.getSourceSite();
h5branding.Utils.getBrandingDomain()
h5branding.Utils.getDomain('http://test.com/foo')
h5branding.Utils.isTc()
h5branding.Utils.inIframe()
h5branding.Utils.getUrlParameter('key')
Analytics
For the moment we have a simple google wrapper available that primarily is meant to set up two trackers (one for game, one for Fabrique) and allows you to send simple screenViews.
The class itself is Called GoogleAnalytics but the lib exposes the property h5branding.google with an instance of this class.
First of all the analytics need to be setup:
h5branding.google.setup(
'UA-436346-23',
'My Games',
'version-2'
);
After that you you can start sending screenviews. We use them to track a user's progress inside a game, and also to measure some KPI's
h5branding.google.sendScreenView('ScreenName');
h5branding.google.sendGenericEvent('Category', 'Action', 'Label');