Category Archives: rstats

Getting Started With BigQuery

As an analyst, you work with data. Sometimes the data is already stored somewhere…acceptable. Sometimes it’s not. Sometimes it might just be good enough to use a text file or excel document. But a lot of times that’s very impractical for a whole host of reasons.

If the data is large, it will take a long time to load and query. If you want to share reproducible results, it may be better if the data is remotely located, somewhere that accessible through code. Also, the data should only be accessible to those that should have access to it (security!).

This is generally solved through using a database, like MySQL, SQL Server or PostgreSQL. However, that requires that you have a server available and that there is a secure (read: encrypted) connection to it. That is not always practical. I have often used a remote MySQL or SQL Server as a solution (sometimes local, but…reproducibility). It has not always been as secure as I would like and scalability could sometimes (read: often) be an issue. Additionally, for data to be accessed efficiently, tables need to be optimized through indexes and server configuration.

If you are looking for data storage that is secure, fast, scalable and self-optimizing, BigQuery might just be the solution you need (I know I sound like a salesperson, but I really like BigQuery). BigQuery is part of the Google Cloud Platform (GCP). Once loaded, you can access data stored in BigQuery securely. In fact, there is no other option. It is hugely scalable as well – practically limitless. It works a lot like a database, but most of the optimization is taken care of by Google. You only need to worry about how you want to structure and query the data. Continue reading

Creating a Multi-Channel Attribution R Shiny App From Google Analytics Data

Not everyone needs to be concerned with multi-channel attribution. If it makes up a very small part of your business, it might not be worth it. However, if you want to get a better understanding of the value of your traffic channels and the transactions/revenue they bring in, you might want to give it a go. Continue reading

How to Analyse Your A/B Tests Using R

A/B testing is one of the best ways to optimise your website. However, it is not a magical cure for websites that are:

  • Poorly Conceived – Website is off-brand or there is a major disconnect with users.
  • Poorly Designed – Website is designed in a way that is hard to maintain/confusing.
  • Poorly Developed – Website has a lot of code bloat or inefficient code.
  • Using Sub-Par/Inflexible Technology – Website is created with technology that allows for very little optimisation or growth.

Continue reading

Creating a Predictive R Shiny App For Google Ads

In this post I am going to go through the code for a relatively simple R Shiny app that will predict Google Ads transactions and cpa (cost per acquisition) for three months plus the current month. There will be a graph and a table of values and four sliders to adjust spend for the current month and the coming three months. You’ll have to experiment with the app to get it to run the way you would like. Continue reading

How to Use R to Identify Poor Performing Google Ads

If you manage Google Ads accounts, you have likely added ads to ad groups and checked their performance over time. It is generally a good idea to have two or three ads in an ad group, running at the same time. Then you can compare them, pause the ads that are not performing well, then introduce new ads.

However, you may have noticed that ads are not always shown equally during a given period. Even if they are, there is often not enough data to determine that one ad is actually better than another. Since we are really looking at a sample, the outcome is not exactly definitive for the population.

Another issue is that you likely have a number of campaigns, with a number of ad groups. That leaves you with a lot of ads to review and determine which ones should be paused (so you can introduce new ads). A corollary to this function is what type of new ads should be introduced – that’ll be for another post.

At the heart of successfully managing media is analytics. In other words, your media success is in proportion to how deeply you utilize your data to make decisions. To that end, in this post I’m going to show you how to create an R Shiny app to run through your ads and display a list of ads that should be paused based on a statistical analysis. Continue reading