Home » Magento SEO » Google Analytics and Magento : 5 Custom Ecommerce Events to Track

Google Analytics and Magento : 5 Custom Ecommerce Events to Track

A friend recently asked me about event tracking on his new Magento ecommerce site. He wondered if I had a comprehensive list of events to track.

Well, in answer to my friend, this article is my list of five favorite event tracking customizations, using Google Analytics, for Magento ecommerce sites.

Click-throughs on Home Page Promotions

For most sites, the home page is the most popular landing page. That makes it valuable real estate, and it means that it deserves a little extra data collection. Home pages tend to have at least one “feature” area, and many have both primary and secondary promotional areas — promoting individual products and special offers or campaigns. There are two things to track about these features.

  • Which ones drive the most or least clicks?
  • Which ones drive the most or least conversions?

Adding a Google Analytics custom event as an onClick event for each promotion makes both metrics readily available, using this tracking code.

With this tracking in place, the report at “Content > Events > Top Events” provides detail on individual click-throughs and subsequent conversions. Drill down on the “Home Page” category and then on “Promo Clickthrough,” and then click the “Ecommerce” link above the chart at the top of the page. The resulting report lists the number of visits where the visitor clicked on each promo link, as well as the revenue, transactions, and conversion rate for each of those visits:

Magento 1_PromoClickthrough

“Promotional Clickthrough” analytics example.

During a single visit, a visitor may click on multiple promotions. If that happens, the visit will be included in each of the individual rows in the report.

Add-to-cart Clicks

Many ecommerce sites have “add to cart” buttons that are not automatically tracked by Google Analytics. If your add-to-cart functionality simply launches an overlay or shows an on-screen message that the product has been added to the cart, then you may not be tracking these actions in a way that is easily accessible.

You may also have “add to cart” buttons on different types of pages: product details pages, “Quick View” overlay pages, and category and shelf pages. If so, event tracking that is well crafted enables you to analyze these actions both by page type and across page types. Use this tracking code to do this.

The standard event tracking report provides detail on how often this functionality is used, which products are added to the cart, and the resulting conversion rate by product. Here’s a sample report.

Magento 2_AddToCart

“Add to Cart” analytics example.

This tagging also enables you to set up a Google Analytics “conversion goal” of “Add to Cart” — setting up a goal of “Event Action = ‘Add to Cart’” — to determine what percentage of traffic to your site, as well as what percentage of specific segments of traffic to your site, add at least one product to their cart.

Unsuccessful ‘Add to Cart’

If you have products on your site that require shoppers to select an option like size, color, or quantity before they can successfully add the product to their carts, then use event tracking to capture how often visitors try to add a product to their cart before selecting a requisite option. Trigger this event at the same time that you display an error message to the visitors letting them know that they need to take additional action. Here’s the tracking code.

The “Error descriptor” can be the exact text that is displayed to the user. Standard event reporting in Google Analytics then displays what errors are being presented, as well as the number of orders that occurred on visits when those errors were displayed. If an error message has a low conversion rate, then it is possible that visitors are actually getting “stuck” and are not, ultimately, able to complete a purchase.

Magento 3_UnsuccessfulAddToCart

Unsuccessful “Add to Cart” analytics example.

You can also look at the ratio of “Events” to “Unique Events” by clicking the Event view under the Explorer tab. A high ratio indicates that visitors are triggering the error multiple times during the visit, which means there is possibly something either broken or confusing about the page design.

To find out which pages these errors are occurring on, choose “Page” from the secondary dimension dropdown.

Unsuccessful Checkouts, Registrations, and Logins

“Add to Cart” is only one of the “user submit” actions on your site. Visitors also click a button to complete their orders, to register with the site, and to log in to the site. If you have form validation built into these features — and you should — then you also need to track how often the form validation events are occurring. Adding event tracking to form validation enables you to monitor if these occur on your site. Here’s a sample tracking code for an unsuccessful “Place Order” click:

And here is sample tracking code for an unsuccessful registration form submission:

Here’s the code for an unsuccessful login:

Accessing the data for each of these errors is similar to what was described in the previous section for unsuccessful add-to-cart clicks.

Site Searches with No Results

Your site search engine provides reports on searches that return “No Results” to the user. But, you may not monitor those reports closely. Moreover, those reports do not tell you whether visitors who unsuccessfully searched went on to find a product and convert to a sale. Google Analytics provides several ways to capture this information. But, once again, this is not information that is captured automatically, and event tracking is often the easiest approach to implement. Simply add the following code to your “No Results” site search page:

With this code implemented, event-tracking reporting shows a list of search terms resulting in no results, which represent an opportunity to add the terms to your search engine’s thesaurus.

magento 4_NoResults

“No Results” analytics example.

You can also set up a custom alert and receive an email if there is a jump in events where “Event Action = No Results,” which will alert you to dig into this report.

Custom Variables

This article has described five ways to use Google Analytics custom event tracking to capture actionable information about your ecommerce site. Google Analytics also supports “custom variables,” which can also be used to capture useful information. See “5 Google Analytics Custom Variables for Ecommerce, “ an article by Justin Cutroni, an analytics consultant, for more.

Customization: No Single Answer

When it comes to data collection and analysis, there is no single right approach. Every site is different. The recommendations in this article may not apply to you; they may not be the highest priority for your site. Hopefully, though, they have illustrated how you can supercharge your Google Analytics implementation to capture data that can directly improve the business results delivered by your site.

About Brian Wilson

avatar
Brian is a freelance Magento developer with 5 years of experience with customizing Magento extensions, magento themes. He's interested in sharing Magento Tutorials to the community

2 comments

  1. avatar

    Hi Brian,

    I have a client with a rather new Magento site that she had an Indian company build for her.
    She sacked them before they completed and just has a contractor finishing the last of the website and it is now live.
    As I do her advertising, I needed to track conversions and analytics so I added an extension but sales would not show as a conversion.
    Long story short, we need someone like you who could setup the Universal GA and conversion codes correctly on her website.
    Can you be hired to do this or suggest another very experience dev to get this done asap, Im a wordpress guy, but this is beyond my efforts.
    Im in Australia, would be great if you got back to me with an answer/ price please.

    Shane M

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Scroll To Top