@azerion/h5-azerion-branding
TypeScript icon, indicating that this package has built-in type declarations

0.13.9 • Public • Published

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:

// This will allow you to get the correct URL to a branding logo
h5branding.Branding.brandingLogoUrl();

// Will open a new window to a site corrosponding to the branding that's leading for the current view location
h5branding.Branding.openCampaignLink('my-game-name', h5branding.UtmTargets.more_games); 

// Should be used to check if the game allows links that escape the game, eg; walktrough buttons, logo's with links.
// h5branding.Branding.brandingLogoUrl honours this logic.
h5branding.Branding.outGoingLinksAllowed();

Apart from these there are some individual helper methods that allow you to check for individual platforms/portals:

h5branding.Branding.isInternal();    // Checks internal portal json
h5branding.Branding.isContracted();  // Checks contracted json
h5branding.Branding.isSpecial();     // Checks special json
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();        // Get the site from which this game/script is loaded
h5branding.Utils.getBrandingDomain()     // Get the Branding that is tied to the current site, will return any of h5branding.BrandingDomain
h5branding.Utils.getDomain('http://test.com/foo')    // Get the domain of any URI, example returns test.com
h5branding.Utils.isTc()                  //  If it runs on internal TeamCity
h5branding.Utils.inIframe()        
h5branding.Utils.getUrlParameter('key')  // Get the value of an url parameter called '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', //The Analytics ID
    'My Games',     //The propery name
    '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');

// As a bonus you can also send Events:
h5branding.google.sendGenericEvent('Category', 'Action', 'Label');

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.13.959latest

Version History

VersionDownloads (Last 7 Days)Published
0.13.959
0.13.845
0.13.70
0.13.60
0.13.50
0.13.40
0.13.30
0.13.20
0.13.10
0.13.00
0.12.170
0.12.160
0.12.150
0.12.140
0.12.134
0.12.120
0.12.110
0.12.100
0.12.93
0.12.80
0.12.70
0.12.60
0.12.50
0.12.40
0.12.30
0.12.20
0.12.10
0.12.00
0.11.20
0.11.10
0.11.00
0.10.110
0.10.100
0.10.90
0.10.80
0.10.70
0.10.60
0.10.50
0.10.40
0.10.30
0.10.20
0.10.00
0.9.00
0.8.40
0.8.31
0.8.10
0.7.00
0.6.00
0.5.30
0.5.21
0.5.10
0.5.00
0.4.20
0.4.00
0.3.30

Package Sidebar

Install

npm i @azerion/h5-azerion-branding

Weekly Downloads

113

Version

0.13.9

License

MIT

Unpacked Size

2.59 MB

Total Files

100

Last publish

Collaborators

  • moin.hasan
  • hulsman1986
  • alebles
  • a.goemans