Data in digital marketing!

We seek to communicate massively by trying to optimize the contact points and make our offer visible by all possible means. However, this strategy now has its limits. Customers prefer a brand that takes their interests and needs into account rather than a brand that promotes its services at all costs. The advantages of Big Data are power:

Our case

We put ourselves in the case of a mid-size business selling clothes online. We will use the data here to better understand the behavior of our customers and refine our marketing campaigns.

How to do it ?

With a variety of server-side technologies that are on the market today, we have a tough job of deciding what kind of backend is most suitable for our app. Our choice will be Firebase Realtime Database.

What is a database?

"A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques. The database management system (DBMS) is the software that interacts with end users, applications, and the database itself to capture and analyze the data. The DBMS software additionally encompasses the core facilities provided to administer the database. The sum total of the database, the DBMS and the associated applications can be referred to as a "database system". Often the term "database" is also used to loosely refer to any of the DBMS, the database system or an application associated with the database. Computer scientists may classify database-management systems according to the database models that they support. Relational databases became dominant in the 1980s. These model data as rows and columns in a series of tables, and the vast majority use SQL for writing and querying data. In the 2000s, non-relational databases became popular, referred to as NoSQL because they use different query languages."

Wikipédia

Why Firebase Realtime Database?

The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync between your users in realtime. With just a single API, the Firebase database provides your app with both the current value of the data and any updates to that data. When your users go offline, the Realtime Database SDKs use local cache on the device to serve and store changes. When the device comes online, the local data is automatically synchronized. Also, it is a Google company so it's conceived to work with Google Analytics and there is a prepared SDK named SDK Firebase who send the data to Firebase Realtime Database. Firebase has an Authentication feature which provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. So, it will allow by authentication to create auto-push or update of users data following the CEO needs.

How does it work ?

First of all, you need to create a database here.
We will need to create an access to our database in our code. We can do it with these lines of code:


We will create a template of data which will look like this:


The purpose of doing so are many: to know the conversion rate per visit, to know which products and colors are trendy, to know from where are our clients (is it spread or located?), to know at which hour we got affluences and how many time do we have to convince them to buy. The combination of both indicators are plenty. These will create KPI who will allow us to upgrade our marketing strategy by knowing more the "persona". For example, we can query for users who are female and who didn't bought and also their time on website. Or we could take a look at how many users have seen red products or coats to determine which category got to be put in front of our website.
At this step it is still impossible to do so because we haven't seen how to create data in our database under Firebase ! The advantage is that we won't have to create manually our data Google Analytics will do it for us ! Here is the official guide of how to combine your Firebase to Google Analytics.
To add data don't forget to create an access to the firebase database google analytics like it is showed in the first picture. Then read in it like this:

Google analytics won't put directly what you want it is up to you to transform the data from Google analytics to your database with lines of codes like these to transfer virgin data into interesting data:

Google analytics can give how many times a page has been visited, which page, how many time, etc. You get to transform it in what interesting you! The plus compare to Google Analytics only is that you will have a progression overview over a long period of time. If you analyse well the changes on your website thanks to it your business will be a success!