appsflyer-python
Documentation
The documentation for AppsFlyer's Server-to-server events API for mobile can be found here.
Installation
Install using pip:
pip install appsflyer
Alternatively, you may download the repository and run the installation directly:
git clone https://github.com/fredericojordan/appsflyer-python.git
cd appsflyer-python
python setup.py install
Getting Started
To start generating events, we need only a Client instance.
The Client needs your AppsFlyer credentials. You can pass these directly to the constructor:
from appsflyer.rest import Client
app_id = "XXXXXXXXXXXXXXXXX"
dev_key = "YYYYYYYYYYYYYYYY"
appsflyer_client = Client(app_id=app_id, dev_key=dev_key)
app_id: The app identifier used in the AppsFlyer dashboard. Insert it precisely as it appears on the dashboard.dev_key: The authentication token in the header. To get the dev key, in the AppsFlyer dashboard go to: App Settings > Dev Key
Generating an Event
To generate an event, simply call Client.generate_event() with keyword arguments:
from appsflyer.rest import Client
app_id = "XXXXXXXXXXXXXXXXX"
dev_key = "YYYYYYYYYYYYYYYY"
appsflyer_client = Client(app_id=app_id, dev_key=dev_key)
appsflyer_client.generate_event(
appsflyer_id="9999999999999-9999999999999999999",
customer_user_id="example_customer_id_123",
ip="199.0.2.1",
app_version_name="example_version_name",
event_time="2020-02-25 12:00.000",
event_name="af_purchase",
event_currency="ZAR",
event_value={
"af_revenue": "1006",
"af_content_type": "wallets",
"af_content_id": "15854",
"af_quantity": "1",
},
)
The parameters event_name, event_value and appsflyer_id are mandatory.
Device Identifiers
Additional data parameters (such as an IDFA or GAID identifiers) may be sent as keyword arguments:
appsflyer_client.generate_event(
appsflyer_id="9999999999999-9999999999999999999",
event_name="af_purchase",
event_value={"af_revenue": "420"},
idfa="9876F1SS-2983-3855-27RR-2R626772VFNB",
)
AppsFlyer API expects one or more of the following device identifiers:
idfaidfvadvertising_id(GAID)oaidamazon_aidimei
Metadata
Release files for appsflyer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| appsflyer-0.1.0.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| appsflyer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / appsflyer-0.1.0.tar.gz
| Download URL | appsflyer-0.1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b08e79708560c523cee6e1167b1b498d1ec63ebbf77a8b71c783400afd8b39f9
|
|
BLAKE2b-256 checksum How to use checksums |
158da49e494ded794c56e05993dbc7daf786d84cae2060a8cf845bfee8eab0aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
|
Release files / appsflyer-0.1.0-py3-none-any.whl
| Download URL | appsflyer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5aac0fdcdbe318ee492ea36cbfb5161a5920bd7778e8fb7eebf429ae038ad561
|
|
BLAKE2b-256 checksum How to use checksums |
5b524c72b920374b0a9ce744096e6cae415362ac80f3d3fd56ee74628407e74f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
|
Security for appsflyer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.