This post outlines a method for analyzing how often pages appear together in user journeys on your website. To do so we utilize R and the Google Analytics API. You can find the full code on GitHub. We will rely on the dplyr, plyr, GoogleAnalyticsR, rio, RcppAlgos, and data.table packages. First we must get our data from Google Analytics. We structure this data such that our dimensions include landingPagePath, secondPagePath, exitPagePath, and previousPagePath. Users will be our metric for these dimensions. Although this does not include all steps within a user journey, this provides a good base for inference for related pages at the beginning and end of user journeys. Once we have our data we need to make some changes before we can begin counting frequencies. First we must change the data from the wide format (i.e. 1 row for each unique path containing the number of users) to…

Read more