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 a…

UserID tracking in 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 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…

Top 5 Events for Google Tag Manager

In the course of consultation with clients, I often get asked this question:

What events would you recommend with an initial install of Google Tag Manager(GTM)?
I usually recommend the following events, not only because they are necessary but also because you can visualize the impact of the container that is the true essence of GTM.

ecommerce Tags The first thing that people add in is the event that fires when a customer has completed a transaction. There are two ways for us to fire this event. One is to use the enhanced e-commerce feature that is inherently built-in to the Universal Analytics tracking tag. All you have to do in this case is go into the tag where all your page views are being tracked and enable enhanced e-commerce tracking. For details, please see below

While you can use any variable to store ecommerce data, leveraging the data layer is the option that works most easily in the Google Analytics reporting domain. Please see how to do this with ease using Google Develop…

The Top 5 Metrics for Content Marketing

How engaging is the content really?
Engagement is a very vague terms so let me clarify it a bit more. All these metrics should be looked at on a long time scale. Use a quarter of a year as a good measure. Content is there for a while and if written well it ages like good wine and carries its flavour for a long while. Pages per session: You should really look to increase the number of pages viewed per visit. This signifies that your site visitors like the content they land on and want to view more of such content. Notice how when you land on National Geographic, you are compelled to look at some more pages. Use recommendation engines for publishers to push this metric up.Bounce Rate: This metric tells you how the site hits a user the moment they land. The visceral reaction, really. Obviously, badly designed pages will have a high bounce rate (defined as one page sessions divided by total sessions in a given time period). However, if you are a media house, it maybe high because your cust…

A note on Demographic information in Google Analytics

The purpose of this post
This tool has started to give us a lot more data about our customers and their demographic information in groups as opposed to individuals. This post will state the amount of information you can glean from Google Analytics about the site users. It will also address the perennial question of what do you do with this information. What is actionable after all? How will your business change after you know this information?
Defining Demographic information
The Google Analytics Help page says that Understanding your audience composition in terms of gender, age, and interests lets you also understand the kinds of creative content you need to develop, the kinds of media buy you should make, and the kinds of audiences you need to develop for marketing and remarketing campaigns.
The cookies tell the tale
Google Analytics gets its information from DoubleClick Third party cookies; from Android advertising ID and iOS identifier for Advertisers. The data that is really available …

Parsing for Pollution

This post is just really a graph of air pollution that we see around the world measured according to the AQI index.

The site is structured very cleanly and allows us to parse the data with ease. I am using Python 3.6
in conjunction with Requests and BeautifulSoup to get AQI index numbers for the top 300 cities of the world by population.

An interesting point to note is that several cities still do not publish pollution indices. It is mind-boggling that governments around the world are taking air pollution so lightly.

Porting this data into Tableau, we get these rather startling graphs

Note how India is higher in this index than China. I would have thought that with all the manufacturing being in China, the pollution levels will be higher there.

Delhi is really off the charts! This level of air pollution means a lot of lung diseases are developing in this very populous city.

The script I am using to get this data is here:

---------------------------------------------START SCRIPT------…

The mirage of Direct Traffic in Google Analytics

All of us have seen it. Few talk about it. Most of us don't want to admit it.
What is this ghost called direct traffic? How could customers/readers suddenly divine my name and land on my homepage. There are various reasons that someone can be captured in this catch-all bucket. All of them point to either incorrect implementation of the Google Analytics code or limitations of it.
These days, with lots of fragmented social networks, much of this direct traffic can also be attributed to links shared via Whatsapp and other channels with no attribution tagging. I would urge marketers to consider these channels too within the share buttons.
So, should we just ignore it? In essence, all that is happening is that the referrer domain is null for some sessions landing on our site.
I posit that we can still find some uses for this nullity. What can they possibly be?
Proportional allocation: Attribution of traffic in such terms as Google Analytics can show us, is not only simple but also simp…