<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0">

<channel>

<title>LEFT JOIN: blog on analytics, visualisation &amp; data science, posts tagged: longread</title>
<link>https://en.leftjoin.ru/tags/longread/</link>
<description></description>
<generator>E2 (v3386; Aegea)</generator>

<item>
<title>Collecting Data on Ad Campaigns from VK.com</title>
<guid isPermaLink="false">27</guid>
<link>https://en.leftjoin.ru/all/collecting-data-on-ad-campaigns-from-vkontakte/</link>
<comments>https://en.leftjoin.ru/all/collecting-data-on-ad-campaigns-from-vkontakte/</comments>
<description>
&lt;p&gt;We have a lot to share in today’s longread: we’ll retrieve data on ad campaigns from Vkontakte (widely popular social network in Russia and CIS countries)  and compare them to Google Analytics data in Redash. This time we don’t need to create a server,  as our data will be transferred to Google Docs via Google Sheets API.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Getting an Access Token&lt;/b&gt;&lt;br /&gt;
We need to create an app to receive our access token. Follow this link &lt;a href="https://vk.com/apps?act=manage"&gt;https://vk.com/apps?act=manage&lt;/a&gt; and click “Create app” on the developer’s page. Choose a name for your app and check it as a “Standalone app”. Then, click Settings in the left menu and save your app ID.&lt;/p&gt;
&lt;p class="note"&gt;More details on access tokens can be found here: &lt;a href="https://vk.com/dev/access_token" class="nu"&gt;“&lt;u&gt;Getting an access token&lt;/u&gt;”&lt;/a&gt;&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/1-4.png" width="730" height="292" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Copy this link:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;https://oauth.vk.com/authorize?client_id=YourClientID&amp;amp;scope=ads&amp;amp;response_type=token&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And change &lt;span class="inline-code"&gt;YourClientID&lt;/span&gt;  to your app ID, this will allow you to get information about your advertising account. Open this link in your browser and you will be redirected to another page, which  URL address holds your generated access token.&lt;/p&gt;
&lt;p class="note"&gt;Access token expires in 86400 seconds or 24 hours. If you want to generate a token with an unlimited lifetime period, just pass scope to the offline parameter. In case if you need to generate a new token – change your password account or terminate all active sessions in security settings.&lt;/p&gt;
&lt;p&gt;You will also need your advertising account ID to make API requests. It can be found via this link, just copy it:  &lt;a href="https://vk.com/ads?act=settings"&gt;https://vk.com/ads?act=settings&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Using APIs to collect data&lt;/b&gt;&lt;br /&gt;
Let’s write a script that would allow us to retrieve information on all user’s ad campaigns: number of impressions, сlicks and costs. The script will pass this data to a DataFrame and send it to Google Docs.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;from oauth2client.service_account import ServiceAccountCredentials
from pandas import DataFrame
import requests
import gspread
import time&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We have several constant variables: access token, advertising account ID and Vkontakte API Version. Here we are using the most recent API version, which is 5.103.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;token = 'fa258683fd418fafcab1fb1d41da4ec6cc62f60e152a63140c130a730829b1e0bc'
version = 5.103
id_rk = 123456789&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To get advertising stats you need to use the  &lt;span class="inline-code"&gt;ads.getStatistics&lt;/span&gt; method and pass your ad campaign ID to it. Since we don’t run any advertisements yet,  we’ll use the  &lt;span class="inline-code"&gt;ads.getAds&lt;/span&gt; method that returns IDs of ads and campaigns.&lt;/p&gt;
&lt;p class="note"&gt;Learn more about the API methods available for Vkontakte &lt;a href="https://vk.com/dev/methods"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use the &lt;span class="inline-code"&gt;requests&lt;/span&gt;  library to send a request and convert the response to JSON.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="Python"&gt;
campaign_ids = []
ads_ids = []
r = requests.get('https://api.vk.com/method/ads.getAds', params={
    'access_token': token,
    'v': version,
    'account_id': id_rk
})
data = r.json()['response']
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;We have a familiar list of dictionaries returned, similar to the one we have reviewed in the previous article, &lt;a href="https://www.valiotti.com/leftjoin/all/analysing-data-on-facebook-ad-campaigns-with-redash/"&gt; “Analysing data on Facebook Ad Campaigns with Redash”&lt;/a&gt;.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/2-4.png" width="993" height="328" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Fill in the &lt;span class="inline-code"&gt;ad_campaign_dict&lt;/span&gt; dictionary as follows: specify ad ID as a key, and campaign ID as a value,  where this ad belongs to.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;ad_campaign_dict = {}
for i in range(len(data)):
    ad_campaign_dict[data[i]['id']] = data[i]['campaign_id']&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Having ID for every ad needed we can invoke the  &lt;span class="inline-code"&gt;ads.getStatistics&lt;/span&gt; method to collect data on the number of impressions,  clicks, costs, and dates for a particular ad, so create several empty lists in advance.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;ads_campaign_list = []
ads_id_list = []
ads_impressions_list = []
ads_clicks_list = []
ads_spent_list = []
ads_day_start_list = []
ads_day_end_list = []&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We need to invoke the &lt;span class="inline-code"&gt;getStatistics&lt;/span&gt;  method for each ad separately, let’s refer to the &lt;span class="inline-code"&gt;ad_campaign_dict&lt;/span&gt; and iterate our requests.  Retrieve all-time data by calling the &lt;span class="inline-code"&gt;‘period’&lt;/span&gt; method with the  &lt;span class="inline-code"&gt;‘overall’&lt;/span&gt; value. Some ads may not have impression or clicks if they haven’t been launched yet, this may cause a  &lt;span class="inline-code"&gt;KeyError&lt;/span&gt;. Let’s recall to the &lt;span class="inline-code"&gt;try — except&lt;/span&gt; approach to handle this error.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;for ad_id in ad_campaign_dict:
        r = requests.get('https://api.vk.com/method/ads.getStatistics', params={
            'access_token': token,
            'v': version,
            'account_id': id_rk,
            'ids_type': 'ad',
            'ids': ad_id,
            'period': 'overall',
            'date_from': '0',
            'date_to': '0'
        })
        try:
            data_stats = r.json()['response']
            for i in range(len(data_stats)):
                for j in range(len(data_stats[i]['stats'])):
                    ads_impressions_list.append(data_stats[i]['stats'][j]['impressions'])
                    ads_clicks_list.append(data_stats[i]['stats'][j]['clicks'])
                    ads_spent_list.append(data_stats[i]['stats'][j]['spent'])
                    ads_day_start_list.append(data_stats[i]['stats'][j]['day_from'])
                    ads_day_end_list.append(data_stats[i]['stats'][j]['day_to'])
                    ads_id_list.append(data_stats[i]['id'])
                    ads_campaign_list.append(ad_campaign_dict[ad_id])
        except KeyError:
            continue&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, create a DataFrame and print out the first 5 data points&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;df = DataFrame()
df['campaign_id'] = ads_campaign_list
df['ad_id'] = ads_id_list
df['impressions'] = ads_impressions_list
df['clicks'] = ads_clicks_list
df['spent'] = ads_spent_list
df['day_start'] = ads_day_start_list
df['day_end'] = ads_day_end_list
print(df.head())&lt;/code&gt;&lt;/pre&gt;&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/3-5.png" width="514" height="172" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;Exporting Data to Google Docs&lt;/b&gt;&lt;br /&gt;
We’ll need a Google API access token, navigate to &lt;a href="https://console.developers.google.com"&gt;https://console.developers.google.com&lt;/a&gt;  and create one. Choose any name you like, then go to your Dashboard and click “Enable APIs and Services”. Choose Google Drive API from the list, enable it and do exactly the same for Google Sheets API.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/g_sheet.png" width="886" height="259" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;After activation you will be redirected to the API control panel. Click Credentials – Create Credentials,  click choose data type and create an account. Choosing a role is optional, just proceed and specify JSON as a key type.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/service_acc.png" width="670" height="472" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;After these steps you can download a JSON file with your credentials,  we’ll rename it to &lt;span class="inline-code"&gt;«credentials.json»&lt;/span&gt;. On the main page you’ll find the email field – copy your email address.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/service_acc_2.png" width="617" height="51" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Go to &lt;a href="https://docs.google.com/spreadsheets"&gt;https://docs.google.com/spreadsheets&lt;/a&gt; and create a new file named  &lt;span class="inline-code"&gt;data&lt;/span&gt;, we’ll pass data from our DataFrame to it. Put the  &lt;span class="inline-code"&gt;credentials.json&lt;/span&gt;  file in one directory with the script and continue coding. Add these links to the scope list:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We will use the  &lt;span class="inline-code"&gt;ServiceAccountCredentials.from_json_keyfile_name&lt;/span&gt; and  &lt;span class="inline-code"&gt;gspread.authorize&lt;/span&gt; methods available in the  &lt;span class="inline-code"&gt;oauth2client&lt;/span&gt; and  &lt;span class="inline-code"&gt;gspread&lt;/span&gt;  libraries for authenticaion process. Specify your file name and the scope variable in the &lt;span class="inline-code"&gt;ServiceAccountCredentials.from_json_keyfile_name&lt;/span&gt; method. The  &lt;span class="inline-code"&gt;sheet&lt;/span&gt; variable will allow us to send requests to our file in Google Docs.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;creds = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', scope)
client = gspread.authorize(creds)
sheet = client.open('data').sheet1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Apply the &lt;span class="inline-code"&gt;update_cell&lt;/span&gt; method to enter new value in a table cell. It’s worth mentioning that the indexing starts at 0, not 1. With the first loop we’ll move the column names of our DataFrame. And with the following loops we’ll move the rest of our data points. The default limits allow us to make 100 loops for 100 seconds. These restrictions may cause errors and stop our script, that’s why we need to use &lt;span class="inline-code"&gt;time.sleep&lt;/span&gt; and make the script sleep for 1 second after each loop.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;count_of_rows = len(df)
count_of_columns = len(df.columns)
for i in range(count_of_columns):
    sheet.update_cell(1, i + 1, list(df.columns)[i])
for i in range(1, count_of_rows + 1):
    for j in range(count_of_columns):
        sheet.update_cell(i + 1, j + 1, str(df.iloc[i, j]))
        time.sleep(1)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In case of success, you’ll get the same table:&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/5-3.png" width="831" height="377" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;Exporting data to Redash&lt;/b&gt;&lt;/p&gt;
&lt;p class="note"&gt;See how you can connect Google Analytics to Redash in this article &lt;a href="https://www.valiotti.com/leftjoin/all/how-to-connect-google-analytics-to-redash/"&gt;«How to connect Google Analytics to Redash?»&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Having a table with Google Analytics and ad campaigns from Vkontakte exported we can compare them by writing the following query:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;SELECT
    query_50.day_start,
    CASE WHEN ga_source LIKE '%vk%' THEN 'vk.com' END AS source,
    query_50.spent,
    query_50.impressions,
    query_50.clicks,
    SUM(query_49.ga_sessions) AS sessions,
    SUM(query_49.ga_newUsers) AS users
FROM query_49
JOIN query_50
ON query_49.ga_date = query_50.day_start
WHERE query_49.ga_source LIKE '%vk%' AND DATE(query_49.ga_date) BETWEEN '2020-05-16' AND '2020-05-20'
GROUP BY query_49.ga_date, source&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;span class="inline-code"&gt;ga_source&lt;/span&gt; — the traffic source, from which a user was redirected. Use the  &lt;span class="inline-code"&gt;CASE&lt;/span&gt; method to combine everything that contains “vk” in one column called «vk.com». With the help of &lt;span class="inline-code"&gt;JOIN&lt;/span&gt; operator we can add the table with the data on ad campaigns, merging by date. Let’s take the day of the last ad campaign and a couple of days after, this will result in the following output:&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/123.png" width="945" height="108" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;Takeaways&lt;/b&gt;&lt;br /&gt;
Now we have a table that reflects how much were spent in ad costs on a certain day, the number of users who viewed this ad, were engaged and redirected to our website,  and then completed the sign-up process.&lt;/p&gt;
</description>
<pubDate>Tue, 26 May 2020 07:15:13 +0300</pubDate>
</item>

<item>
<title>Metrics for marketing analytics</title>
<guid isPermaLink="false">19</guid>
<link>https://en.leftjoin.ru/all/metrics-for-marketing-analytics/</link>
<comments>https://en.leftjoin.ru/all/metrics-for-marketing-analytics/</comments>
<description>
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;&lt;figure class="block-color-gray_background callout" style="white-space:pre-wrap;display:flex; background: #f8f8f8; "&gt;&lt;/p&gt;
&lt;div style="font-size:1.5em"&gt;&lt;p&gt;&lt;span class="icon"&gt;☝&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div style="width:100%; "&gt;&lt;p&gt;Today in this update we have a long-read, supported by a telegram-channel &lt;a href="https://t.me/smmrus"&gt;Russian marketing&lt;/a&gt; on the subject of analytical metrics in marketing. Within the article we’ll discuss what marketing analytics is needed for, which metrics one should operate at calculation of marketing efficiency, how one can structure the work on building marketing reporting. Moreover, we will touch upon high-level KPI, discuss quite popular framework and sort out how to compute important analytical indicators. The article came up rather voluminous, and various abbreviations are used hereby, therefore we couldn’t do without a glossary.&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;ul class="toggle"&gt;&lt;li&gt;&lt;details close=""&gt;&lt;summary&gt;&lt;strong&gt;Glossary&lt;/strong&gt;&lt;/summary&gt;
&lt;ul id="dcd6802d-fbeb-46e8-8bf1-18eb3f19e1e7" class="bulleted-list"&gt;
  &lt;li&gt;Revenue / Income / Sales — revenue, income (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;GMV — Margin (% / rub. ) &lt;/li&gt;
  &lt;li&gt;MAU — Monthly active users (persons)&lt;/li&gt;
  &lt;li&gt;WAU — Weekly active users (persons)&lt;/li&gt;
  &lt;li&gt;DAU — Daily active users (persons)&lt;/li&gt;
  &lt;li&gt;Requests — Requests (of advertising) (units)&lt;/li&gt;
  &lt;li&gt;Impressions — Displays (of advertising) (units)&lt;/li&gt;
  &lt;li&gt;Clicks — Clicks (on advertising) (units)&lt;/li&gt;
  &lt;li&gt;FR — Fill rate ( =Impressions / Requests) (%)&lt;/li&gt;
  &lt;li&gt;CTR  — click through rate ( =Clicks / Impressions) (%)&lt;/li&gt;
  &lt;li&gt;С1  — conversion first purchase (%)&lt;/li&gt;
  &lt;li&gt;R, R1, R3, R7  — retention (of the 1st, the 3rd, the 7th day) (%)&lt;/li&gt;
  &lt;li&gt;RR (rolling retention) (%)&lt;/li&gt;
  &lt;li&gt;Churn — Outflow (%)&lt;/li&gt;
  &lt;li&gt;ARPU — average revenue per user (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;ARPPU  — average revenue per paying user (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;cARPU  — cumulative average revenue per users (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;LTV (lifetime value) / CLV (customer lifetime value) — Customer lifetime value&lt;/li&gt;
  &lt;li&gt;ROI  — return of investment (%)&lt;/li&gt;
  &lt;li&gt;ROAS  — return on advertising spend (%)&lt;/li&gt;
  &lt;li&gt;ROMI  — return of marketing investment (%)&lt;/li&gt;
  &lt;li&gt;CPA  — cost per action (for example, purchase or installation of an app) (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;CPC  — cost per click (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;CPO  — cost per order (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;CPS  — cost per sale (rub. / $ / euro)&lt;/li&gt;   
  &lt;li&gt;CPM (cost per mille) — cost per thousand advertising displays (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;CAC  — customer acquisition cost (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;CARC  — customer acquisition and retention cost (rub. / $ / euro)&lt;/li&gt;
  &lt;li&gt;SAC — share of advertising costs (%)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;h2&gt;What marketing analytics is needed for?&lt;/h2&gt;
&lt;p&gt;In order to figure analytical metrics out, for starters we need to find out why we need marketing analytics and which questions it can reply. In general, marketing analytics  is research and measurement of marketing activity in quantitative indicators. At that, most often, the aim of these actions is to evaluate the efficiency of marketing, calculate the return on marketing investments in the company.&lt;br /&gt;
Marketing analytics helps to find answers to the following questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;How efficiently the marketing budget is allocated?&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Which ROMI do various marketing channels provide?&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Which target audience is the most effectively converted?&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Which communication channels are the most / the least profitable?&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;What is the biggest source of company’s profit?&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Marketing analysis is better to be initiated from identification of key business indicators and links therebetween, we’ll talk about it a bit later. In general, work on building of marketing analytics is more like creation of the system of proper metrics, their planning, measurement and reaction to changes of these metrics. More thoroughly the cycle &lt;a href="https://en.wikipedia.org/wiki/PDCA"&gt;PDCA&lt;/a&gt; is described in a book of &lt;a href="https://www.ozon.ru/context/detail/id/3327206/"&gt;W.Deming &amp;quot;Way out of crisis&amp;quot;&lt;/a&gt;, I recommend you to get familiar with it.&lt;/p&gt;
&lt;h2&gt;&lt;i&gt;Key principles of building proper analytics in marketing&lt;/i&gt;&lt;/h2&gt;
&lt;p&gt;Applying a systematic approach to analysis of data affecting the marketing activity can help marketologists to solve a problem, eliminate pain, provide recommendations for further marketing strategical steps. System approach implies abiding by a number of key principles, without which the analytics will turn out to be incomplete.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Competence&lt;/b&gt;&lt;br /&gt;
The task of marketing data analysis should be performed by a professional, who gets along with basics of mathematical statistics, econometrics and, obviously, can calculate, interpret the results and draw conclusions, relevant for a specific business (i.e. understanding the industry). Only in this case, the analytics can be fruitful, otherwise incorrect conclusions based on the data can even exacerbate the situation, that will lead not to budget optimization, but to devastation thereof.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Objectivity&lt;/b&gt;&lt;br /&gt;
Solving a task, one should address the data affecting a problem from various points of view. Different indicators, different aggregation of the data will allow to look at the problem objectively. It is desired, that the very same conclusion based on the data is repeated at least two times.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Relevance&lt;/b&gt;&lt;br /&gt;
Studying current problems one shouldn’t operate the outdated retrospective data, the world is changing extremely fast, same way as the situation on the market / in a company. The analysis, held one year ago, today might have absolutely different results, therefore one needs to update the reports and data therein on a regular basis.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Interpretability&lt;/b&gt;&lt;br /&gt;
Results of analysis should be clear for a person from business, not familiar to technical terminology. In a perfect scenario – each report helps to wisely sort a problem out and pushes a reader to obvious conclusions. The situation, when an analyst is forced to dig into a huge pile of graphs, unclear charts and pages with numbers without any conclusions is inacceptable.&lt;/p&gt;
&lt;p&gt;Such principles will surely help to hire competent analysts for building proper accountability.&lt;/p&gt;
&lt;h2&gt;How to structure indicators?&lt;/h2&gt;
&lt;p&gt;The system of metrics, helping to evaluate the marketing effectiveness, can be built based on the several considerations. One of the key approaches to structuration is customer’s lifecycle. Let’s try to sort it out and speak about one of the interesting frameworks for working on such system of metrics. The following major stages can be allocated in the life cycle of a customer.&lt;br /&gt;
1) Audience attraction – work of a marketing specialists starts even prior to the moment when potential audience turns into clients of a company&lt;br /&gt;
2) Engagement – stage of conversion of users who came to a website / mobile app into registered customers&lt;br /&gt;
3) Monetization – stage of formation of paying users (from the number of registered ones)&lt;br /&gt;
4) Retention / Churn – events dedicated to development and retention of the attracted audience, decreasing of the churn level&lt;/p&gt;
&lt;h2&gt;Method AARRR / Pirate Metrics&lt;/h2&gt;
&lt;p&gt;In 2007 Dave McClure developed and proposed a method called AARRR – the system of metrics, allowing start-ups to get to the bottom of business indicators. Another name of the method that can be also met, — &amp;quot;pirate metrics&amp;quot; due to the fact that the name is pronounced in a pirate way: &amp;quot;aarrr!&amp;quot;.&lt;br /&gt;
So, let’s sort the approach out and speak about the metrics, responding to each step of the &amp;quot;funnel&amp;quot;. The abbreviation consists of 5 key marketing stages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Аcquisition — corresponds to paragraph 1 above&lt;/li&gt;
&lt;li&gt;Аctivation — corresponds to paragraph 2 above&lt;/li&gt;
&lt;li&gt;Retention — corresponds to paragraph 4 above&lt;/li&gt;
&lt;li&gt;Revenue — corresponds to paragraph 3 above&lt;/li&gt;
&lt;li&gt;Referral — recommendations (recently introduced stage)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the entrance to the funnel our target audience that we desire to acquire is placed. Then, we are trying to do everything possible to register a potential buyer and turn him into a registered client (by that moment, a person who visited our site / app should realize the value of our product). Thereafter, a client conducts purchases and returns to us again and again. In the end, if he really likes our product, he will recommend it to his friends / acquaintances.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/pirate-metrics-AARRR-funnel.png" width="750" height="500" alt="" /&gt;
&lt;div class="e2-text-caption"&gt;AARRR-funnel, pirate metrics (&lt;a href="https://thewayofdamasio.com/aarrr-pirate-metrics-and-the-growth-hacking-mindset/"&gt;image source&lt;/a&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On every level of the funnel you need to choose metrics, describing transition from one state to another, that we can calculate and analyze. Let’s have an insight into each of the steps and metrics that correspond thereto. We’ll be studying each based on the example of real organizations, in order for calculation of indicators to be maximally comprehensible in practice.&lt;/p&gt;
&lt;h2&gt;Acquisition&lt;/h2&gt;
&lt;p&gt;Reach of potential customers is a key stage of formation of the new audience. let’s examine this crucial stage based on the example of a some mobile app and channels of traffic attraction. Oftentimes, the audience comes to application from several different sources:&lt;/p&gt;
&lt;ol start="1"&gt;
&lt;li&gt;Organic traffic: search Google, Yandex, Bing, etc&lt;/li&gt;
&lt;li&gt;Organic mobile traffic: search in Apple Store / Google Play&lt;/li&gt;
&lt;li&gt;Commercial traffic: advertising in Facebook / Instagram, context advertising (Adwords), mobile advertising networks.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We’ll discuss it, using the example of an ad in Facebook. Each advertising announcement is targeted on the potential advertising audience, which is called &lt;i&gt;&amp;quot;Reach&amp;quot;&lt;/i&gt; within the Facebook terminology. At that, we can optimize impressions of an ad by clicks / conversion / etc. Our task is to get as effective audience as possible for minimal amount of money. Consequently, we need to select metrics that will help us to evaluate efficiency. Let’s study them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Impressions&lt;/b&gt;&lt;/i&gt; —  number of advertisement displays, the indicator itself won’t say a lot and is extremely linked to the volume of potential audience, however we will need it for understanding of other metrics.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Clicks&lt;/b&gt;&lt;/i&gt; — number of clicks on ad in absolute figures also depends on the number of impressions.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Installs&lt;/b&gt;&lt;/i&gt; — number of clients who installed the mobile app&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;CTR&lt;/b&gt;&lt;/i&gt; — click through rate, calculated as Clicks / Impressions ratio and shows how efficient our ad is from the point of audience’s interest. in other words, what is click through rate of our ad.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;CR&lt;/b&gt;&lt;/i&gt; (conversion rate) (= Installs / Clicks) — level of conversion, shows which percent of users have installed the app from those, who clicked on the advertising announcement&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Spend&lt;/b&gt;&lt;/i&gt; — amount of money that we’ve spent on this advertisement&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;CPC&lt;/b&gt;&lt;/i&gt; (= Spend / Clicks) — shows us the cost of one click. We should operate this indicator in comparison with other ads / market benchmarks&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;CPM&lt;/b&gt;&lt;/i&gt; (= Spend / Impressions * 1000 ) — shows us the cost of thousands of impressions of an add. It is used for comparison with other ads / benchmarks&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;CPI&lt;/b&gt;&lt;/i&gt; (= Spend / Installs) — unit value of one install&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Revenue&lt;/b&gt;&lt;/i&gt; — final revenue that we receive from this advertising announcement / campaign (you need to have tools for the proper attribution)&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;ROAS&lt;/b&gt;&lt;/i&gt; (= Revenue / Spend) — return on investments to advertising, gross income from a dollar spent. Metric shows the efficiency of advertising campaign from the point of money invested into it. For example, if ROAS is equal to 300%, it means that on every 1$ spent, 3$ were earned, and if ROAS is equal to 30%, it means that on every 1$ spent 30 cents were earned.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thus, we already have quite good metrics palette that we can work with – examine their dynamics, compare the advertisements between each other and between various traffic sources. For example, a simple table, containing these indicators will already be the first approaching to understanding the advertising efficiency.&lt;/p&gt;
&lt;h2&gt;Facebook Campaign Efficiency&lt;/h2&gt;
&lt;div class="e2-text-table"&gt;
&lt;table cellpadding="0" cellspacing="0" border="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Advertisement&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Spend ($)&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Installs&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;CPI&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Impressions&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;CPM&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Clicks&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;CTR&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;CPC&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;ROAS&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Creative-1&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Creative-2&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;td style="text-align: center"&gt;x&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This table can be reconstructed in a way, that we have dates vertically, and campaign is selected from the filter, thus we will start understanding the changes in dynamics of key indicators of traffic acquisition.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;: We can measure CTR of various banners and understand which from them is more appealing for the audience. this indicator can be used at A/B testing of the very same banner with selection of the most effective one. At calculation of effectiveness, you need to keep in mind CPC apart from CTR, in order to select not only the most clickable banner, but also not the most expensive one.&lt;/p&gt;
&lt;p&gt;Key KPIs, indicators of efficiency in terms of money – &lt;b&gt;CPI&lt;/b&gt; / &lt;b&gt;ROAS&lt;/b&gt;, the first one shows how cheap / expensive we procure the traffic, and the second one – how well the traffic procured is monetized.&lt;/p&gt;
&lt;h2&gt;Activation&lt;/h2&gt;
&lt;p&gt;Let’s assume that we are developing a mobile game. Let’s think of what can be activation of user in this case? We have attracted users, who have installed a game to their smartphones. Our next task is to register a user (to make him a player), propose him an introduction tour to pass.&lt;br /&gt;
On this stage two metrics can be considered the key ones &lt;b&gt;conversion into a registered user&lt;/b&gt; (= Registrations / Installs), &lt;b&gt;conversion into users who passed a tutorial&lt;/b&gt; (=Tutorial Users / Installs).&lt;/p&gt;
&lt;p&gt;Consequently, these two metrics will show us whether we require way too much from a user on the stage of registration, or, vice versa, the registration is very simple for him. The second metric will show how comprehensible the introduction to the game is, whether users are interested in passing the introduction tour, whether we require enough actions from a user.&lt;/p&gt;
&lt;p&gt;Moreover, the last metric can be decomposed, if within the tutorial process a user needs to conduct several actions, we can examine the funnel of conversions into each of actions and understand the problematic spots of activation of new users. After activating our audience, we need to keep it, so we can make money thereafter.&lt;/p&gt;
&lt;h2&gt;Retention&lt;/h2&gt;
&lt;p&gt;Any organization would prefer to have an active base of loyal clients, who make repeating orders on a regular basis. Due to this fact, it is extremely important to track down a few key metrics: retention rate (or Rolling retention), Churn. I was sorting out construction of &lt;a href="all/retention-rate/"&gt;retention and rolling retention reports&lt;/a&gt; more thoroughly in one of the last blog’s articles.&lt;/p&gt;
&lt;/p&gt;&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/Retention@2x.png" width="585" height="200" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;b&gt;Sticky Factor&lt;/b&gt; can be considered another crucial and fundamental metric — that is the level of engagement of users. Sticky Factor for a week is calculated rather easily: &lt;i&gt;DAU / WAU * 100%&lt;/i&gt;. Let’s sort it out in more details based on the last example. The same way as before, we have a table — &lt;i&gt;client_session&lt;/i&gt;, in which for every &lt;i&gt;user_id&lt;/i&gt; the timestamps of activity are stored &lt;i&gt;created_at&lt;/i&gt;. Thereafter, calculation of Sticky is quite easily performed with the following SQL-request:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;SELECT daily.dau/weekly.wau*100 AS sticky
FROM
-- Calculating the average DAU for a week
( SELECT avg(dau) AS dau
FROM
(SELECT from_unixtime(cs.created_at, &amp;amp;quot;yyyy-MM-dd&amp;amp;quot;) AS event_date,
ndv(cs.user_id) AS dau
FROM client_session cs
WHERE 1=1
AND from_unixtime(cs.created_at)&amp;amp;gt;=date_add(now(), -7)
AND from_unixtime(cs.created_at)&amp;amp;lt;=now()
GROUP BY 1) d) daily,
-- Calculating WAU for a week
( SELECT ndv(cs.user_id) AS wau
FROM client_session cs
WHERE 1=1
AND from_unixtime(cs.created_at)&amp;amp;gt;=date_add(now(), -7)
AND from_unixtime(cs.created_at)&amp;amp;lt;=now() ) weekly&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Along with the fundamental metrics we shall address also the metrics, connected to the tools of client base retention. These can be represented by the tools of direct marketing: sms, email, push-notifications. Each tool usually has the following descriptive metrics: &lt;i&gt;number of messages sent&lt;/i&gt; / &lt;i&gt;number of messages delivered&lt;/i&gt; / &lt;i&gt;number of users returned&lt;/i&gt;. They showcase the efficiency of each of the tools.&lt;/p&gt;
&lt;h2&gt;Monetization&lt;/h2&gt;
&lt;p&gt;Finally, we have reached the very key metric, that represents a point of interest of all the business users – &lt;b&gt;money&lt;/b&gt;. Revenue, profit – money that we receive from users at acquisition of our product. In absolute figures, this metric (or the result of company’s activity) is not highly indicative, however it’s important for understanding of the future trends.&lt;/p&gt;
&lt;p&gt;Most often, the following number of relative metrics are used, that describe the behaviour of users:&lt;br /&gt;
&lt;b&gt;ARPU&lt;/b&gt; ( = Revenue / Users )— average revenue per one user&lt;br /&gt;
&lt;b&gt;cARPU&lt;/b&gt;( = cumulative Revenue / Users ) — cumulative average revenue per one user&lt;br /&gt;
&lt;b&gt;ARPPU&lt;/b&gt; ( = Revenue / Payers ) — average revenue per paying user&lt;br /&gt;
&lt;b&gt;Avg Receipt&lt;/b&gt; (= Revenue / Purchases ) — average check&lt;br /&gt;
&lt;b&gt;LTV / CLV&lt;/b&gt; — aggregate revenue per one user (life value of a customer)&lt;/p&gt;
&lt;p&gt;I am planning to dedicate a separate post to an issue of LTV, since it’s quite a wide subject. In this post we’ll figure out ARPU, cumulative ARPU and connection with LTV. The metric ARPU shows us how much we earn on a user on average for some period of time (normally, it is a week or a month). It is useful information, however it might be not enough. The task of efficient marketing is to attract such users, that bring company more money than the amount that is spent on attraction thereof. Thus, if we are modifying the indicator ARPU and review the cumulative ARPU for 30, 60, 90, 180 days, for instance, we will receive quite a good approximation to an LTV of a user. Would be even better if we build a curve of cumulative ARPU by days.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/Revenue-CPI@2x.png" width="585" height="200" alt="" /&gt;
&lt;div class="e2-text-caption"&gt;Curve of cumulative ARPU&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;By adding &lt;i&gt;CPI&lt;/i&gt; as a horizontal line, we will obtain a graph that is extremely useful for understanding. In the point of two lines’ intersection we get a day, starting from which the revenue from a user becomes higher than the costs on his acquisition (user’s acquisition becomes effective). In the example that we observed above that is the &lt;i&gt;56th&lt;/i&gt; day of client’s life. Solution of this task is like searching for a break-even point, however we need to keep in mind that company bears also other indirect costs, that need to be considered in order to calculate the break-even point correctly.&lt;/p&gt;
&lt;h2&gt;Referrals&lt;/h2&gt;
&lt;p&gt;Recommendation of products of the company to friends, relatives and acquaintances can be considered as the best scenario of interaction with clients and the highest level of reward for the company. With regard to metrics, the following can be allocated: &lt;i&gt;number of activated invited new users per one client&lt;/i&gt; and &lt;i&gt;NPS&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;Number of activated referrals allows to increase CAC / CPI. For example, we attract a user for $1 and want to preserve such a tendency. We have developed mechanics of referral links and revealed that now, after implementation, an average user invites two other users. So, in this case, the cost of acquisition of a user will be equal to $1 / 3 = $0.33. Consequently, we can afford acquiring users for $3, maintaining the value of CAC that is acceptable for us.&lt;/p&gt;
&lt;p&gt;NPS (Net Promote Score) —  metric, that showcases the level of customer loyalty. The mechanics of calculation thereof &lt;a href="https://en.wikipedia.org/wiki/Net_Promoter"&gt;is thoroughly described in Wikipedia&lt;/a&gt;, therefore we won’t stop on this point. Let’s just say that it is recommended to measure NPS on a regular basis, using direct marketing communication channels.&lt;/p&gt;
&lt;h2&gt;Hierarchy of metrics within an organization&lt;/h2&gt;
&lt;p&gt;We have examined crucial metrics of every stage of AARRR quite thoroughly, and now all we have left is to find out how we can structure the indicators in order to receive a perfect dashboard.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/dashboard.png" width="390" height="395" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;For the solution of this task, it would be wise to decompose the goals of the company and the metrics corresponding thereto into different levels. Oftentimes, each subsequent level corresponds to a company’s department and represents KPI of this department. To put it simply, we can imagine the main high-level goal of the company – Profit and decompose it into components: Revenue and Costs.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/Ierarchy@2x.png" width="444.5" height="168.5" alt="" /&gt;
&lt;div class="e2-text-caption"&gt;Hierarchy of metrics within an organization&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A good example is a school of English – SkyEng, on the &lt;a href="https://drive.google.com/file/d/1sRCHG1LO6f2QtrkmcfdjRScCsEG0EM0k/view"&gt;video&lt;/a&gt; you can get familiar to the thoroughly designed structure of metrics of SkyEng.&lt;/p&gt;
&lt;p&gt;Another alternative might be construction of dashboard structure on the basis of AARRR framework, sorted out above. Schematically, such dashboard will look as follows:&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/dashboard-example@2x.png" width="275.5" height="375" alt="" /&gt;
&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Today we have studied the key marketing metrics, that will help to track the changes on every stage of marketing funnel and tell you about the efficiency of each stage, as well as become useful tool of any marketologist’s activity.&lt;/p&gt;
&lt;h2&gt;References to the topic:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.pierrelechelle.com/aarrr-pirate-metrics"&gt;AARRR: Pirate Metrics for SaaS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://habr.com/ru/post/448962/"&gt;The effectiveness of the marketing funnel AARRR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tilda.education/articles-aarrr-metrics"&gt;Promotion under the method AARRR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rezart.agency/blog/analytics-marketing-guide/"&gt;Analytics in marketing, specificities of digital, tools and check-list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vc.ru/marketing/32256-privlech-polzovatelya-i-zarabotat-na-nem-effektivnost-marketingovoy-voronki-aarrr-na-primere-tinder"&gt;Acquire a user and earn on him: efficiency of marketing funnel AARRR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.promopult.ru/management/vazhnost-marketingovoj-analitiki.html"&gt; Importance of marketing analytics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;style&gt;
figure {
	margin: 1.25em 0;
	page-break-inside: avoid;
}
.callout {
	border-radius: 3px;
	padding: 1rem;
}
ol,
ul {
	margin: 0;
	margin-block-start: 0.6em;
	margin-block-end: 0.6em;
}

li &gt; ol:first-child,
li &gt; ul:first-child {
	margin-block-start: 0.6em;
}

ul &gt; li {
	list-style: disc;
}
ul.toggle &gt; li {
	list-style: none;
}
ul.bulleted-list &gt; li {
	list-style: disc;
}
ul {
	padding-inline-start: 0.8em;
}
ul.toggle {
	padding-inline-start: 0em;
}
ul &gt; li {
	padding-left: 0.1em;
}
.toggle {
	padding-inline-start: 0em;
	list-style-type: none;
}

/* Indent toggle children */
.toggle &gt; li &gt; details {
  padding-left: 0.0em;
}

.toggle &gt; li &gt; details &gt; summary {
	margin-left: -0.4em;
}

.block-color-gray {
	color: rgba(55, 53, 47, 0.6);
	fill: rgba(55, 53, 47, 0.6);
}	
&lt;/style&gt;
</description>
<pubDate>Tue, 17 Dec 2019 13:25:56 +0300</pubDate>
</item>


</channel>
</rss>