Integrating AppsFlyer tracking with Construct2



952 visits, 1,190 views



This tutorial hasn't been translated.


This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Hello everyone!

Let me share the process to enable AppsFlyer tracking using Construct2, since there is no current plugin or workaround (as far I researched).

With the help of AppsFlyer support we managed to found something you can do to make it work.

First, let's assume the following:

- You have already your AppsFlyer Dev Key

- You have already your Application ID (for iOS)

- You will build your application using Phonegap Build (Cordova)

1. Lets take in consideration that you already have your game exported with Cordova in Construct.

2. Download and install Node.js:

3. Download and install git client:

4. Execute in windows command prompt: C:\>npm install -g cordova

5. First please check if you have platforms/ios or platforms/android folder inside your game.

6. If platforms folder does not exist, navigate through command line to your game root folder, and execute following command:

a. cordova platform add ios or

b. cordova platform add android, depending of the store

Note: If you have other plugins or additional config.xml settings, make sure to prepare them before executing any cordova command, since this will update automatically config.xml for discovered plugins.

7. Next we need to add cordova appsflyer plugin inside the game. This can be done by executing following command, it will came with all scripts that you need:

a. cordova plugin add cordova-plugin-appsflyer-sdk

8. Last step is to do the init code, you should call the init code inside file which is called at the start of the game, it can be some js, for example (index.js) or index.html file, where you will call js code. Here is example where it is added inside index.html file script code:

     var options = {
               devKey:  'xxXXXXXxXxXXXXxXXxxxx8',
               isDebug: false,
               onInstallConversionDataListener: true               
           var userAgent = window.navigator.userAgent.toLowerCase();
          if (/iphone|ipad|ipod/.test( userAgent )) {
               options.appId = "123456789";        // for iOS      



9. Please remember that appID need to be changed for your application.

Lastly, check on your appsflyer dashboard if installation was registered.

Hope this can help in case you need to integrate AppsFlyer in your projects!



  • Order by
Want to leave a comment? Login or Register an account!