A Paradigm for Business Intelligence Evolution


This is a series of ideas that will outline how we need to build an e-commerce Analytics solution for a digital marketing agency or consultant to join the data from all channels and client’s data together in one central repository. This data should include online transactional data as well social interactions.

This repository should also be able to import offline customer information too. Additionally, this data will then be combined to create analyses across platforms and, ultimately to be used as a source of predictive analysis.

We will end this document with some timelines around the tools to use, the timelines around their deployment and kind of internal team to execute this plan.


Process Flow in Summary

  1. Setting up data collection within current data sources.
  2. Merging all data sources into one platform and automate such a collection.
  3. Analyzing patterns in these datasets to builds reports and dashboards based on KPIs
  4. Based on past behavior of customers, create prescriptive and predictive Analytics around key metrics and goals.


Data Collection

It is imperative to get all the measurements set up correctly in every marketing tool that is used. We tend to focus mostly on Google Analytics and believe that data alone. Sometimes, when tagging is incorrect on email platforms, Facebook or Bing, we cannot even measure conversions in the same way and that leads to reporting that is erroneous and leads to bad decisions. In this step, it is important to measure each source of traffic to a web domain and be able to capture that either within that domain (for example: clicks from Facebook reporting) or make it work so that the data is captured correctly in another tool like Google Analytics or Adobe Analytics. We need to be able to account for 90% of traffic correctly before we move ahead.

As this data collections are all in separate silos that usually do not support each other well, we will get some numbers that will be off between each tool. That is a cost of doing business at this stage and we should only focus the primary data source when making decisions. For example, if we want to determine whether Facebook CPC is effective, we use the conversion metrics from Facebook reporting rather than try and match that data with Google Analytics.

This becomes rather onerous and requires us to look at several disparate places to get a complete picture of our business, so we then are forced, for the sake of efficiency to move to the next stage.

Merging Data Sources

At some point the enterprise slows down because there is too much data, but no unit can understand the other’s language. If there is an Analytics team, an SEO and SEM team, the confusion arising from a lack of a “single source of truth” can be quite debilitating in terms of decision making. At this point we start to go down two different pathways. We can either build our own data warehouse or buy a tool that will do this for us.

Building a data warehouse comes with the advantage of designing your own data collection and downstream KPI’s that the can be customized as desired. There is a high initial cost but then the flexibility of operation tends to result in increased ROI. Dealing with internal resources also means a quick deployment of any changes and newer traffic sources can be ingested sooner. The data warehouse can be used with any of the data visualization tools like Tableau, Power BI, Qlik or Google Data Studio.

Buying a data merging tool like, Alteryx, Looker, ReportGarden, Optymyzer or BIME has it’s advantages in that the initial cost is lower and they provide built-in connectors to all major data sources. You can also customize them by importing new data sources using API’s or just csv files. Over time, they also end up creating new features and introducing concepts of machine learning and programmatically produced insights that can be of great use to clients also. One doesn’t have the flexibility of an in-house team though.

For an agency, perhaps the latter option is one to start with and the former to aim for in the long-term if the revenues from the Analytics stream are high enough.



Once the processes are in place and perhaps even at the point of data collection, we need to have a core set of people who are going to make sense of all the analysis and provide recommendations to the clients based on all the dashboards and reports that can be built. It has been my experience that lots of dashboards are made and reports are regularly generated but the consumption on the client side is poor because the analytics practice does not translate the numbers into business speak. Please read this great article by Avinash Kaushik that further elaborates the point.

I cannot stress enough the fact that the quality of good analysis and a set of concrete recommendations that clearly explains what the client is going to get by following them goes a long way in the adoption of data driven decision making. For example, a recommendation that says “Moving the add to cart button 300 pixels up will increase revenues by $30k a month” is much better than saying “We find that testing suggests moving the button 300 pixels up will increase conversion rates”

A good web analyst will have experience working with product development, a smattering of coding and long exposure to different kinds visualization techniques. An investment in a good resource(s) of this kind will yield more value over time than the best tools around.


Predictive Analytics

Once a website is running and customers are using it, a one size model in terms of pricing, deals or discounts does remain a good strategy for long. Very soon clients run into a wall where they keep acquiring new customers or current customers without enough understanding of any of them. At this point, you are looking for tools that segment the population in meaningful chunk and target them based on their needs at a particular time. A pet food company can predict when a customer will run out of the current cat food that they have purchased and send a targeted message (email or ad or website chat) at the right time.

There are several open source languages like R or statistical packages like SAS and Tableau that can help an internal analytics team do this work for a client. These require the in-house team to have a strong data science background to create a product offering for clients. This method will give you the best ROI because the tools will be made in-house and can be customized based on a client.

The other method is to buy a tool like Domo, Qlik, clearbit, Zaius and use it’s features to conduct user based analyses that can segment and target customers in different ways.


Timelines for Capability Development

NOW: We are doing Data collection and collation right now in our efforts to serve customers. Pulling data for separate business functions from different tools is the ground situation now.


Six Months: We can build up a capability using an external tool to combine data sources and provide comprehensive and cross-platform reporting.


18 Months: It will take a lot of time and learning to build up an analytics resource team in-house that has experience in all the different domains. If you start hiring now, such a team will be able to start adding value within six months and be giving very good ROI in a year and a half.


2 Years: This is the time it will take for a good team and a set of tools to be able to make deep inroads and to build predictive analytics and modeling capabilities. It will also take time for our client base to become mature enough to realize that this is the ultimate need for any online business.



I hope this plan gives you a sense of what I think the plan to success in the e-commerce Analytics domain. There are many ways besides this to get data together and put analytics to work but in the e-commerce world this should work the best.




Google Tag Manager

GDPR Compliance for Google Tag Manager and Google Analytics

The time is upon us when we all have to comply with the EU’s regulations on privacy. While websites in the USA don’t have to technically comply BUT everyone accessing your site from the EU is protected under this statute and so it is best for all of us to “get with the ball game”, so to speak.

So what are we supposed to do? Let me list down the steps that need to be taken.

Step 1: Data storage in Google Analytics. Please go into the Property Setting and look for the Data Retention menu as below:

Make Data Retention as long as possible

Click on the tab and you will see choices of how many months of data to keep. I went for 50 months because that is the maximum time explicitly allowed. I wouldn’t recommend “Do not automatically expire” option because it is quite vague.

The option “26 months” is a Google-suggested default, just so you know. Here is some more information on Retention.

Step 2: Anonymize IP. If you use Google Tag Manager as any normal human being should, this is a very simple setting change. Please go into the Universal Analytics tag that fires on every page view and set the Fields to Set to have anonymizeip as TRUE.


Now, the last 4 digits of a user’s IP will be marked as ‘0000’ and you cannot identify them in any way. Not that you were doing anything with it but still, that is the guideline.

If you are not able to use GTM for any reason, just change the normative collection by adding the following to every page of your site.

<!– Global site tag (gtag.js) – Google Analytics –>

Step 3: Advertising and Re-targeting. Some of the more conservative folks are recommending that you shut down the re-targeting and advertising features in Google Analytics. If you are not using them, do turn them off, otherwise there is no harm in keeping them on.


Step 4: Set up a cookie consent form. The best recipe that I have seen is by our friends at AnalyticsMania. This is a great a quick recipe to install using Google Tag Manager. It will put you in more compliance than is absolutely necessary.

One more thing…..

Step 5: Audit your site so that there is no PII being sent to Google Analytics. So any emails, userID’s or any unencrypted content. I know a lot of folks who have email addresses floating around in URL’s or events.

Please desist!

You do not want to be banned from Google. Getting back in requires and lot of work. Clean all new data collection to make sure nothing personal gets recorded in Google Analytics. Read this article; memorize if necessary.

You are all done and now can rest easy that the EU will not come after you.


UserID tracking in Google Tag Manager(GTM)


Why do we need to do that?

Ostensibly Google says that you do this for tracking true users of your site. Since multiple devices generate a visitor cookie each, they get counted as different visitors. You can stitch sessions cross-device by creating a userid view.

However, if we want to track CAC and LTV by referral sources and we have only Google Analytics and an internal database around, we can piggyback on this method to measure them.

It is tricky and will require some testing before it runs in your environment. However, it works and I have managed to figure it out in Google Tag Manager and will lay it out for you dear analyst, step by step.

Step 1

Create the User-ID view in Google Analytics. Go to the Property and expand “.js tracking Info”. Then follow the prompts as seen in the picture below.


After you have done the above, let’s create a dimension to store this data.

Step 2

In the same property column, below the PRODUCT LINKING tab, sits a place to create custom dimensions as shown in this picture below.



Click on create dimension and add the custom dimension as shown below:


Please note that you have to name it userID. This is because I am going to name the data layer variable later the same. They have to be so to capture your user information.

Step 3

Have your awesome developer pass the user-id value to the data layer variable called userID. The values that it should spit out if you click “view-source” on your site should look like this:

dataLayer = [{‘userID’: ‘yyyyyy’}];

dataLayer.push( {‘event’:’uidAvailable’, ‘uid’:’yyyyyy’} );

They can push this change live anytime and will be quite thankful for the Starbucks drink you will treat them to.

Make very sure that this userID being made cannot be Personally identifiable information(PII). So no names, email addresses, etc.

Step 4

Ok! Let’s push on now to the Google Tag Manager and the last part of this implementation.

Open up your tag manager and on the left hand side where it says, variables, click and add a user defined variable. We will call it userID.


Now, on the left hand side open up the tags section. On all the tags that have anything to do with an event or page view, we will make slight edits. Let’s start with the Google Analytics tag (it should be set to universal Analytics otherwise this will not work).


We add two variable to be filled when the tag fires, one is the userId (please note that this is the exact name you need to set). The other is the custom dimension that we have created in Google Analytics so we can run reports based on our own user-ids, which I am sure, are aligned to email addresses.

Step 5

Now, let’s set our workspace on Google Tag Manager to Preview the changes that we have made. If this works, the Real-Time reports in Google Analytics will immediately start collecting data. Once it works, then go ahead and publish the new tags.

Now, you should be free to download the userID and referral source. You can download the LTV and userID from your own database and analyze in Excel or any other spreadsheet of your choice.

You would have noticed that I keep harping on the name and case of the variable “userID” and “userId”. I thought to name all variables the same and it didn’t work. However, hard-coding the variables works perfectly!

Do let me know if you have any issues with this and I can walk you through the implementation, if need be.

Analytics, Google Tag Manager

Tracking Google Analytics Events in Squarespace


In the world of freelancers one does come up against massive walls of code that are really not made to work with one another. In setting up Google Analytics tracking on any site that is made in wordpress, Wix or Squarespace, one encounters all sorts of peculiarities.

I am going to talk of capturing events in Google Analytics from within the Squarespace environment.

First of all, the normal way to integrate Google Analytics in Squarespace is easy enough. Just do the following:

Config  — >  Settings  –> Advanced  –> External Services

and put the UA-XXXXXXX-Y number in there.

However, please note that this will conform to Google Analytics tracking that is several generations old.

This is just page view tracking though.

How does one add event tracking where a new page is not going to be called?

I am going to describe how you do this for a newsletter capture lightbox in Squarespace.

It turns out that there are three ways to do this although only one works for me. I am listing all three in case my environment is weird and the other ways might work for you.

1. Use Javascript shenanigans:

Essentially, what you want is to pass the event code to Google Analytics only when the submit button on the lightbox is clicked. For that you set up a listener to call a function which fires the event tracking code when called. This is very well described by Rocketeer SEO Hero and also by Silvabokis.

This did not work for me. Even though I tried several combinations but the variable value that should get assigned to 1, never happened.

2. Try and force Google Tag Manager(GTM) to do this for you:

GTM is not supported directly in Squarespace. You have to take your GTM header code below:

<!– Google Tag Manager –>


new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],




<!– End Google Tag Manager –>

and put this on Config  — >  Settings  –> Advanced  –> Injection (Header)

Then take the code that should reside in the body tag

<!– Google Tag Manager (noscript) –>


<!– End Google Tag Manager (noscript) –>

and put it here  Config  — >  Settings  –> Advanced  –> Injection (Footer)

This is also described well by Yoweb.

Now go to Google Tag Manager and build an event only tag that collects data when a trigger is fired upon a particular form class is seen. Please see this wonderful description ( read carefully for this process is convoluted) by Atomic Marketing.

3. Try to play within Squarespace:

This is a simple technique and did work for me. Go to the newsletter form and click on edit.


Click on Advanced and then scroll down to ” Post-Submit HTML”.

Now, this is a place where you put in the event call as follows:

   ga(‘send’, ‘event’, ‘newsletter’, ‘click’, ‘submit’);


Effectively, you are stating the Event Category [newsletter], Event Action [click] and Event Label [submit].

Go into the Google Analytics interface and add these values as a desirable goal and you are done. This method is quite simple but please be aware that this may not work like this if Google stops supporting this or Squarespace updates their codebase.

In any event, I hope this article is of some use. Do let me know if you have any further questions.

Analytics, Freelancing

The virtues and challenges of Freelancing

The days go by and you are sitting at your desk at home waiting….

…waiting for someone to respond. That great job post you saw yesterday was just so tailor-made for you. They have to call you! They would be stupid not to.

…and you wait some more. You watch TV in frustration thinking of how you are just wasting your life away for calls that never come; messages that go unanswered; and proposal that go unseen.

The perils of freelancing are many. Waiting for someone to give you a first break is one. In my early months, I always thought that I was doing something wrong, hence the lack of jobs. Slowly, I realized that while I did make mistakes, the nature of the business is such that it will take you years to get settled. Particularly, if you don’t have actionable coding skills. So waiting is a significant part of the job.

The other problem that most of us who are not salespeople encounter is the amount of rejection that is the norm. When working for a company, your work is not rejected everyday. There is an automatic buy-in from your employer on whatever you do within certain parameters like performance reviews. While freelancing, one is rejected constantly. Over time time, I have learnt to expect 90% rejection, at least. Once you do that, it becomes the new norm and you don’t lose too much sleep over it.

A third major issue I encountered was the constant selling of yourself or your skills. One doesn’t have to do this in a regular job. It is taken as read by your colleagues that your skills are of some value. One could argue that you make a better case for advancement in an organization if you sell your ideas better than others. However, in freelancing it is all about the sales pitch. You have to hone several pitches for different kinds of jobs and be unremitting in your proposal follow-ups. No one looks at your resume and very few actually read your profile. Almost all of my jobs are a result of personal conversation via Skype or the phone. Conversations that were all about selling myself!

The great joys of working on your own time are many too. I have gone through a very bad health phase ( a bit of jujitsu with cancer) and this allowed me to work whenever I was able to. The flexibility that a freelancer has is probably the most important selling point to this style of work. There is true joy in working at your own convenience. Be disciplined and keep weekly to-do lists. You are your own boss and employee too.

Working on various different projects and problems also forces you to keep on top of new technologies and better ways of doing work. Continuing education is another great asset of freelancing. I have learnt more about coding in the last six months than I did in the last three years. There is no administration overhead and that generates enormous amounts of free time for one to learn. I usually look to UdemyCoursera and the O’Rielly Bookshelf to help stay in touch with all the goings on out there. Youtube is a serious source of learning too.

Another thing that relates to one’s usage of time is the opportunity to just get up and go somewhere during the day. The time of rest between jobs and within them cannot be had in any other lifestyle. I have found time to go to the museums, drive around for fun and volunteer for various non-profit organizations. I have found a lot more time to cultivate relationships and talk to my family: the important stuff of living, really.

It’s a good life but in the beginning, like every business, it is a hard life. You just need to remember not to let the waiting, rejection and relentless sales pitches get to you. Also, make sure that you continue to bid or reach out for jobs all the time. Don’t sit back. A freelancer, ironically, cannot afford to be too relaxed.

Still interested in going down this garden path…

Then the best places that you can freelance in my opinion are, UpworkToptal web developers Community and Freelancer. You can also find some freelance work on Linkedin if you build relationships there.

Let me know if you have any questions.  I will be happy to help.