Analytics & Container Scripts

How to use UA & Analytics for your game on Pley?


Optional Power Tool

This feature is in its early stages and requires Javascript & Analytics/UA experience to use.

We'll work closely with you as a partner to enable whatever UA and analytics need you might have.
Please reach out to us on Discord to discuss and learn more.

Pley supports a myriad of ways to get actionable insights for optimizing your marketing and understanding your players. Supporting your analytics stack (e.g., Facebook Pixel, Google Tag Manager, and other custom integrations) is incredibly important for us at Pley.

Playing games on the web isn't like playing an installed app - it all takes place within a website. Playing your game either on or through an embed on your own page, it always happens through an iFrame called a "container".


What is a Pley Container?

A container is an iFrame where the game runs; on or in an embed. JavaScript can be added to the container to run while the game starts. This lets you add scripts to integrate third-party services like Google Tag Manager and Meta Pixel, just like you would to a website.

Container scripts are optional. You can just leave them empty without any issues.


A script for Google Tag Manager is added to the container, and will run in the iFrame when the game launches.

How to use container scripts?

The Container is the iFrame that your game runs in on the web (either on or as an embed on any website). You may leave it completely empty unless you have specific needs for it. Container scripts are not required (Optional) to get your game running -- leave them empty if you'd like!


Don't worry about adding any script to your container - it isn't needed right now, so leave it empty.

1) Select Container in the Game Manager, you can list all your existing container versions.

2) Press New version, to create your first empty container.

3) You can configure your IFrame scripts here. You can test run your scripts together with a build by pressing Run.

4) Press Save & Create version once you're ready to save the container (empty is fine) so it can be used in upcoming releases. You'll see it's no longer marked as a draft in the container list.


Container Scripts are Optional!

The Container holds a set of scripts that execute in the IFrame that your game is running in. This allows you to add your own custom analytics, UA tools, or integration scripts such as Google Analytics, GTag, Facebook Pixel, or any other service that can be implemented on a website using javascript.


Here is an example of integrating Google's analytics service into your container!


Changing created containers?

Note that you can not edit the scripts in the Container version once it has been created.
If you later want to make changes to your container, you will have to create a new version.

Documentations for UA/Analytics Services

Integrating Google Tag Manager

Integrating Meta Pixel


How do I create containers to write scripts in?

Click here to learn how to create and edit containers.