Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few commits #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 70 additions & 76 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,40 @@ order: 9
hidden: true
slug: ue-api
---

## Table of content

- [Init SDK](#init-sdk)
- [Start](#start)
- [Log Event](#log-event)
- [Get AppsFlyerUID](#get-appsflyeruid)
- [Set Custom User Id](#set-custom-user-id)
- [Uninstall tracking](#uninstall)
- [iOS Uninstall](#ios-uninstall)
- [Android Uninstall](#android-uninstall)
- [Set Additional Data](#set-additional-data)
## [Table of content](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#table-of-content)

- [Init SDK](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#init-sdk)
- [Start](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#start)
- [Log Event](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#log-event)
- [Get AppsFlyerUID](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#get-appsflyeruid)
- [Set Custom User Id](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#set-custom-user-id)
- [Uninstall tracking](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#uninstall)
- [iOS Uninstall](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#ios-uninstall)
- [Android Uninstall](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#android-uninstall)
- [Set Additional Data](https://github.com/AppsFlyerSDK/appsflyer-unreal-plugin/blob/master/docs/API.md#set-additional-data)

## Init SDK

<img src="https://files.readme.io/70a3db6-ProjectSettings2.png" width="650"/>

- **Dev key** - Found under App Settings in your AppsFlyer Dashboard.
- **App id** - app id from the itunes store (without the 'id' prefix)
- **Is debug** - Used to dub to AppsFlyer SDK. (Development Only!). Once this is set up the AppsFlyer SDK can log all Installs and Sessions.

- **Currency Code (only iOS)** - Defines the app currency method

- **Disable SKAdNetwork(Only iOS)** - Disable SKAdNetwork sessions

- **Automatically start the AppsFlyer SDK** - When set to true, the SDK will be sending a session automatically (before Blueprint events). If set to false, it's the developer responsability to call the start API from the Blueprint.
- **AppsFlyer Dev Key** - Obtain the Dev Key from the AppsFlyer Dashboard in the App Settings section.
- **Apple App ID** - Obtain the app ID from the iTunes store (without the `id` prefix)
- **Is debug** - Once this is enabled the AppsFlyer SDK can log all Installs and Sessions.
- **Currency Code (only iOS)** - Set the app currency.
- **Disable SKAdNetwork (Only iOS)** - Disable SKAdNetwork sessions.
- **Automatically start the AppsFlyer SDK** - When set to `true`, the SDK sends the session automatically (before Blueprint events). When set to `false`, it's the developer's responsibility to call the start API from the Blueprint.

## Start

- Starts the SDK by sending the session to the server.
- By default, the `start` method is called automatically once the app is being launched.
- If needed, this setting can be disabled in the Plugin settings, and the developer can call the `start` method under the blueprint. When doing so, the SDK will send a session on every background-foreground transition.

- As a default, the start method is being called automatically once the app is being launch.

- If needed, this setting can be disabled in the Plugin settings, and the developer can call the start method under the blueprint. When doing so, the SDK will send a session on every background-foreground transition.
<img src="https://files.readme.io/6fe8c83-autoStartOff.png" width="400"/>
![](https://files.readme.io/6fe8c83-autoStartOff.png)

## Log Event

- In-app events help you track how loyal users discover your app, and attribute them to specific
campaigns/media-sources. Please take the time define the event/s you want to measure to allow you
to track ROI (Return on Investment) and LTV (Lifetime Value).
- The `logEvent` method allows you to send in-app events to AppsFlyer analytics. This method allows you to add events dynamically by adding them directly to the application code.
The `logEvent` method allows you to send in-app events to AppsFlyer.

<img src="https://files.readme.io/26545c3-TrackEvent.png" width="1100"/>

Expand All @@ -57,91 +49,93 @@ For more on in-app events check out the AppsFlyer **Knowledge base** [here](http

To receive unique AppsFlyer ID per app installation you can use this blueprint:

<img src="https://files.readme.io/4bdabe0-GetAppsFlyerUID.png" width="300"/>
![](https://files.readme.io/4bdabe0-GetAppsFlyerUID.png)

## Set Custom User ID

Setting your own Custom ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with postbacks APIs for cross-referencing with you internal IDs.
Setting your own Custom ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with postback APIs for cross-referencing with your internal IDs.

<img src="https://files.readme.io/88552e9-CustomUserId.png" width="1100"/>

**IMPORTANT**: In order for the user ID to be define in the first SDK session, please follow these steps:
**IMPORTANT**: To set the user ID in the first SDK session, please perform the following:

1. Set the `Automatically start the AppsFlyer SDK` flag under the plugin setting to false.
<img src="https://files.readme.io/6fe8c83-autoStartOff.png" width="500"/>

<img src="https://files.readme.io/6fe8c83-autoStartOff.png" width="500"/>
2. Call the `Set Custom User ID` API before the call to the `Start` API under the Blueprint:

## Uninstall

AppsFlyer uses silent push notifications, once a day, to verify if an app is still installed on a given device. If there is no response, an uninstall is recorded, and it's attributed to the media source that originally brought the user.
AppsFlyer uses silent push notifications, once a day, to verify if an app is still installed on a given device. If there is no response, an uninstall is recorded, and attributed to the media source that originally brought the user.

First, make sure to read the relevant information regarding [uninstall feature in the AppsFlyer dashboard](https://support.appsflyer.com/hc/en-us/articles/210289286-Uninstall-measurement)
First, make sure to read the relevant information about the [uninstall feature in the AppsFlyer dashboard](https://support.appsflyer.com/hc/en-us/articles/210289286-Uninstall-measurement)

### iOS Uninstall

**Important!**

1. To support remote notification in IOS follow the [official unreal docs](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/LocalNotifications).
1. To support remote notifications in iOS follow the [official unreal docs](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/LocalNotifications).

Don't forget to [download, compile and run Unreal Engine from the source](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/DownloadingSourceCode) .
<img src="https://files.readme.io/88552e9-CustomUserId.png" width="1100"/>
Don't forget to [download, compile, and run the Unreal Engine from the source](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/DownloadingSourceCode).

2. After the Unreal engine is running, open the Unreal IDE and go to settings > platforms -> iOS -> enable the remote notification support checkbox.
<img src="https://files.readme.io/0f87999-iOSenableRemoteNotification.png" width="1100"/>
<img src="https://files.readme.io/88552e9-CustomUserId.png" width="1100"/>

3. Under the setting -> Maps & Mods -> Game instance -> change the instance class to PlatformGameInstance
<img src="https://files.readme.io/ddfa068-gameInstance" width="1100"/>

4. Configure the nodes under the relevant blueprint:
<img src="https://files.readme.io/4a4549b-nodeEvents.png" width="1100"/>
2. After Unreal Engine is running, open the Unreal IDE, go to settings > platforms -> iOS, and check **Enable Remote Notification Support**.

- **Register for remote notification** Will show a pop-up to the user from the OS, asking permission for remote notification
<img src="https://files.readme.io/0f87999-iOSenableRemoteNotification.png" width="1100"/>

- **Application registered for remote notifications delegate** call AppsFlyer uninstall API from [iOS lifecycle](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app)
3. Under the setting -> Maps & Mods -> Game instance -> change the instance class to `PlatformGameInstance`

- **AppsFlyerSDK remote notification token** call AppsFlyer API for sending the token.
<img src="https://files.readme.io/ddfa068-gameInstance,png" width="1100"/>

5. To debug enable AppsFlyer debug logs and check for the Register endpoint

<img src="https://files.readme.io/0b3a257-iOSLogs.png" width="1100"/>
4. Configure the nodes under the relevant blueprint:

### Android Uninstall
<img src="https://files.readme.io/4a4549b-nodeEvents.png" width="1100"/>

For Android make sure to complete the steps in the [following article](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app)
- **Register for remote notification** Will show a pop-up to the user from the OS, asking permission for remote notification
- The a**pplication registered for remote notifications delegate** call AppsFlyer uninstall API from [iOS lifecycle](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app)
- **AppsFlyerSDK remote notification token** call AppsFlyer API for sending the token.

1. Configure [Firebase cloud messaging](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app#http-v1)
5. When debugging, enable AppsFlyer debug logs and check for the Register endpoint

2. Follow the steps to [integrate into the app](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app#integrate-fcm-into-the-app)
<img src="https://files.readme.io/0b3a257-iOSLogs.png" width="1100"/>

3. Make sure to use appsFlyer.FirebaseMessagingServiceListener service, embedded in the SDK. This extends the FirebaseFirebaseMessagingService class, used to receive the FCM Device Token:
### Android Uninstall

```xml
<application
<!-- ... -->
<service
android:name="com.appsflyer.FirebaseMessagingServiceListener">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<!-- ... -->
</application>
```
Complete the steps in the [following article](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app)

4. Same nodes could be used (as in iOS) for Android under the relevant blueprint (no API call needed).
<img src="https://files.readme.io/4a4549b-nodeEvents.png" width="1100"/>
1. Configure [Firebase cloud messaging](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app#http-v1)
2. Follow the app integration steps in [this article](https://support.appsflyer.com/hc/en-us/articles/360017822118-Integrate-Android-uninstall-measurement-into-an-app#integrate-fcm-into-the-app).
3. Use the `appsFlyer.FirebaseMessagingServiceListener` service, embedded in the SDK. This service extends the `FirebaseFirebaseMessagingService` class, used for receiving the FCM Device Token:

```xml
<application
<!-- ... -->
<service
android:name="com.appsflyer.FirebaseMessagingServiceListener">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<!-- ... -->
</application>

```
4. The same nodes as in iOS could be used for Android under the relevant blueprint. No API call is needed.

<img src="https://files.readme.io/4a4549b-nodeEvents.png" width="1100"/>

## Set Additional Data

Use to add custom key-value pairs to the payload of each event, including installs. These values will appear in raw-data reports.
Add custom key-value pairs to the payload of any in-app event, installs included. The values will appear in raw-data reports.

<img src="https://files.readme.io/3ebf06f-setAdditionalData.png" width="500"/>
<img src="https://files.readme.io/3ebf06f-setAdditionalData.png" width="1100"/>

**IMPORTANT** In order for the additional data to be included in the first SDK session, please follow these steps:
**IMPORTANT** To include the additional data in the first SDK session, peform the following:

1. Set the `Automatically start the AppsFlyer SDK` under the plugin setting to false.
<img src="https://files.readme.io/6fe8c83-autoStartOff.png" width="500"/>
1. Set the **Automatically start the AppsFlyer SDK** under the plugin setting to false.

<img src="https://files.readme.io/6fe8c83-autoStartOff.png" width="500"/>
2. Call the `setAdditionalData` API before the call to the `Start` API:
<img src="https://files.readme.io/4d9cd34-setAdditionalDataBeforeStart.png" width="500"/>

<img src="https://files.readme.io/4d9cd34-setAdditionalDataBeforeStart.png" width="500"/>
19 changes: 7 additions & 12 deletions docs/BasicIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@ slug: ue-integration
---

# Setup

First open Settings > Project Setting... and locate AppsFlyer under the Plugins section.
To enable AppsFlyer detect installs, app opens and update events perform the following:
1. Open **Settings** > **Project Setting...** and locate **AppsFlyer** under the **Plugins** section.

<img src="https://files.readme.io/bacb543-ProjectSettings1.png" width="700"/>

## Setup parameters

Set your App_ID (iOS only), Dev_Key and enable AppsFlyer to detect installations, sessions (app opens) and updates.
> This is the minimum requirement to start tracking your app installs and is already implemented in this plugin. You **MUST** modify this call and provide:
**AppsFlyer Dev Key** - Your application devKey provided by AppsFlyer.<br>
**Apple App ID** - ***For iOS only.*** Your iTunes Application ID.<br>
**Is Debug** - When enabled the AppsFlyer SDK debug logs will be printed (development only!)
2. Setup the following
**AppsFlyer Dev Key** - Your application devKey provided by AppsFlyer.
**Apple App ID** - ***For iOS only.*** Your iTunes Application ID.
**Is Debug** - Print AppsFlyer SDK debug logs.

<img src="https://files.readme.io/70a3db6-ProjectSettings2.png" width="1100"/>

Once your dev key and app_id is set you are ready to use AppsFlyer.

You will also need to make sure your package name is set up with a AppsFlyer Dashboard.
3. Make sure your package name is set up in the AppsFlyer platform.

<img src="https://files.readme.io/bacb543-ProjectSettings1.png" width="700"/>
4 changes: 2 additions & 2 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ slug: ue-installation

# Installation

* In your game’s root directory, create a folder named Plugins
* Copy the AppsFlyer folder into it. You should have something like
1. In your game’s root directory, create the **Plugins** directory
2. Copy the **AppsFlyer** folder into the **Plugins** dirrectory to create the following file hierarchy:

```
MyProject
Expand Down
Loading