tutorial"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

load("my_appsflyer_data.RData")
library(appsflyeR)

library(dplyr)
library(ggplot2)

Goal

The goal here is to outline in a couple of paragraphs and few lines of code some simple ways in which we can use the Windsor.ai API and R package appsflyeR to gain insights into marketing campaign performance. The nice thing about Windsor.ai is that you can have all of your marketing channels aggregating in a single place and then access all data at once using this package. In this case, however, the package is focused on getting marketing data from AppsFlyer. Of course, once the data is in R you can do much more than the examples below, and work on analysis, predictions or dashboards.

Getting data from AppsFlyer into R

After we create an account at Windsor.ai and obtain an API key, collecting our data from Windsor to R is as easy as:

my_appsflyer_data <-
  fetch_appsflyer(api_key = "your api key",
           date_from = Sys.Date()-100,
           date_to = Sys.Date(),
           fields = c("campaign", "clicks",
                      "spend", "impressions", "date")) 

This code will collect data for the last 100 days. Lets take a look at the data we just downloaded to get a better idea about the structure and type of information included.

str(my_appsflyer_data)

Analyzing AppsFlyer marketing data

Now we can analyze data from AppsFlyer data. For instance, let's compare the two campaigns we have to see which one performed better the last 100 days.

ggplot(my_appsflyer_data, aes(y = clicks, fill = campaign)) + geom_boxplot()

It looks like APAC campaign is performing better than UK&CO in number of clicks. Now let's see if this difference is statistically significant by using generalized linear models, as our variable response is number of clicks, which have a Poisson distribution.

lmod <- glm(clicks ~ campaign, data = my_appsflyer_data, family = "poisson")
summary(lmod)

We can see that differences among campaigns are statistically significant and that the campaign UK&CO have a mean that is 0.79 lower than the APAC campaign.



Try the appsflyeR package in your browser

Any scripts or data that you put into this service are public.

appsflyeR documentation built on Dec. 2, 2022, 5:13 p.m.