\documentclass{article}
\usepackage{fullpage}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage[natbibapa]{apacite}
\usepackage{eso-pic}
\AddToShipoutPictureBG{\AtPageLowerLeft{\includegraphics[scale=0.7]{powered-by-Authorea-watermark.png}}}

\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}

\usepackage{authblk}

\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}



\begin{document}

\title{How to perform behavioral cohort analysis with Google Analytics}


\author[ ]{Alberto Pepe}

\affil[ ]{}
\vspace{-1em}


\date{}

\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup




If you run a company or a website, \textbf{cohort analysis} is a great
way to understand engagement and retention of your users. For example,
how many of your users who signed up in June went back to your site in
July? The chart below, for example, shows that \textbf{33.36\% of all
users who signed up on Month 0, came back to the site on Month 1}.
Google Analytics
\href{https://support.google.com/analytics/answer/6074676?hl=en}{recently
added cohort analysis} to the set of metrics that they offer to their
users, so that you can generate retention curves like the one below on
the fly. It is still in Beta, but it allows you to understand user
retention over time, especially if you use Google Analytics with
\href{https://support.google.com/analytics/answer/3123669?hl=en}{User ID
view}, that is: you track data of signed up users with accounts.\\\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/all-users-fake/all-users-fake}

\end{center}
\end{figure}

However, not all users are the same. When they first sign up to your
site, new users may actually behave in different ways. Their behavior
determines whether they will stick to your site or not. A more advanced
version of cohort analysis is \textbf{behavioral cohort analysis}. The
famous example of this is Facebook's realization, based on user
research, that: \emph{if a new user adds 7 friends in the first 10 days
of using Facebook, they will become an engaged user}. Why is this type
of analysis important? If you want to maximize engagement and retention,
knowing what features / behaviors will make users stick can inform
tremendously product building. In the case of Facebook, they changed
their onboarding process to incentivize new users to add 7 friends in
the first 10 days.\\

There are a number of companies that give you metrics based on user
behavior (\href{https://amplitude.com/}{Amplitude}, for example). They
offer advanced analytics that let you study user behavior in detail.
However, if you want to start doing basic behavioral cohorts (for free!)
you can use Google Analytics to obtain some good results. Here's how:\\

\textbf{1.} As a first step, \textbf{you need to let Google Analytics
track some events that are meaningful to you}. For example, you may want
to track, similar to Facebook, friend invites. You need
to~\href{https://support.google.com/analytics/answer/1136960}{add Event
tracking code to your site} in order to let Google Analytics know every
time an event is triggered (the code will ping Google Analytics every
time an action is taken, e.g. a new user invites a friend).\\

\textbf{2.} If you have set up event tracking correctly, you can now
navigate to your Events Overview in Google Analytics (Behavior
\textgreater{} Events) and you shall see all your events. You can group
events in categories if you like.~\textbf{You now have to define
Advanced Segments}~to group the users who take certain actions (e.g.
``invite a friend'') into a separate user segment. Go back to the Cohort
Analysis page, and click on Add Segment and then New Segment (red
button)\\\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/new-segment/new-segment}

\end{center}
\end{figure}

\textbf{3.} Create \textbf{a new segment that reflects your desired
event}. Under Advanced \textgreater{} Conditions, select the Event
Action (or Label or Category) you wish to segment upon, e.g. ``Invite''.
This will create a segment containing ALL the users on your site who
have used the export feature. \textbf{IMPORTANT}: Make sure you are
segmenting Users, not Sessions (see selected value between ``Filter''
and ``Include'' in the image below)\\\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/users/users-2}

\end{center}
\end{figure}

\textbf{4.} \textbf{You're done!} Save the Advanced Segment and you will
now be able to \textbf{see how retention changes for users who behave
differently.} The image below shows \textbf{how} \emph{\textbf{users who
invite a friend}} \textbf{retain compared to} \emph{\textbf{all
users}}\textbf{.} (43.28\% vs 33.36\%).\\\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/results1/results-2}

\end{center}
\end{figure}

\selectlanguage{english}
\FloatBarrier
\end{CJK}\end{document}

