Fomos chamados para curar feridas

No evangelho de hoje (ver São Mateus 9:18–26), temos duas grandes situações e milagres operados por Jesus, perante seu ministério público; a cura da mulher hemorrágica e a ressurreição de uma menina…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




AUTOMATING GOOGLE ANALYTICS EVENTS TRACKING

How to automate google analytics event tracking

The evolution of the software world is quickly rendering manual processes not only obsolete but particularly annoying for the few who have not yet figured out how to transition.

Recently, a client reached out to my team, frustrated about the tedious task of having to manually track the performance of their custom google analytics events. They had tried a few methods, all manual and all of which proved to be just as time-consuming and inefficient.

In this article, I’m going to walk you through the steps for automating Google Analytics Event Tracking. Before doing that, I want to make sure there is a clear understanding of two elements: events and the datalayer.

Events can be considered as the interactions that users have with the content on your page. When users click on a button to sign up for newsletters, download content from your site or even visits your page, those can all be tracked using google analytics.

In order to track events, Google Analytics uses a global JavaScript object called the ‘dataLayer’. This object holds all the relevant data related to your events. It can also store variables if you need to access those as well. Using this object is not a must, but events cannot be utilized without the object and it is best to use the functions provided by Google alongside a data layer. This will make it much easier for the data in the dataLayer to be referenced.

As seen in the test file above, declare and initialize the browsePage object in order to easily access the methods of the page object. This will offer cleaner code as well as better readability.

Once the result is received, the test will verify if the event was found or not.

Note that this tutorial is written to test for one event but can be modified to check for several events in the dataLayer.

Add a comment

Related posts:

Why it works

Timeblocking is a productivity tool for planning your day. I find it works better than (a) working through a list of tasks and (b) not having a plan (unsurprisingly). To timeblock a day, you allocate…

Sunday Puncher Newsletter

Another shiny thing on a platter to try and entice you into subscribing. The stationery is top-f*king-quality, so I suggest you go over to Patreon and get yourself set up. Pro tip: $1 gets you in the…

The Last Little Leaf

I just spent several days with my family — my two adult sisters and my mother. My stepfather died and we gathered together to move through the first few days after his death together. We wanted to…