Hacking Google Analytics: Ideas, Tips and Tricks

Leveraging web analytics, particularly tools like Google Analytics, is crucial for understanding the digita

Hacking Google Analytics: Ideas, Tips and Tricks Leveraging web analytics, particularly tools like Google Analytics, is crucial for understanding the digital footprint of any website. These tools cater to the broad requirements of websites across the spectrum, offering a foundational insight into traffic metrics. However, their ability to delve into specific inquiries is often limited.Addressing these specific queries may require circumventing the limitations of existing software. To illustrate this point, I’ll propose three innovative approaches to extract additional insights when integrated with Google Analytics. This article aims to serve as a springboard for further exploration.Google Analytics excels in identifying the final webpage a user visited before arriving at your site, typically referred to as the ‘referrer’ or ‘referral path’. This information is valuable for understanding visitor pathways to your site. Yet, not all visitors convert on their first visit.It’s common for customers to revisit a site multiple times before making a purchase or becoming a regular user. Relying solely on the last referral path, as reported by tools like Google Analytics, can miss out on opportunities and fail to provide comprehensive actionable insights. Fully harnessing all referrers per visitor in Google Analytics is a complex task, and the resulting reports still may not address all questions.Here’s a more effective approach:

Upon each visit, Google Analytics logs the referral source in a specific cookie named __utmz.

A JavaScript workaround can duplicate this referral data into a cookie managed by your website, rather than Google Analytics.

With each subsequent visit, Google Analytics updates its cookies. The JavaScript hack ensures your website cookie is updated by appending the new referral to the existing data.

Upon conversion, upload the content of the updated cookie to your database alongside customer details.

A sample script demonstrating this process is provided below. Feel free to modify and refine it for your needs.function createCookie(name, value, days) { if(days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = “; expires=” + date.toGMTString(); } else { var expires = “”; } document.cookie = name + “=” + value+expires + “;domain=” + window.location.hostname + “; path=/”; } function readCookie(name) { var nameEQ = name + “=”; var ca = document.cookie.split(‘;’); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ‘ ‘) c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length,c.length); } } return null; } function googleCookieReferrer() { var feed=readCookie(“__utmz”); if(feed.indexOf(“utmcsr”)==-1) { return null; } if(feed != null) { if(feed.indexOf(“%7C”) != -1) { feed = feed.split(“%7C”); feed = feed[0].split(“%3D”); } else { feed = feed.split(“|”); feed = feed[0].split(“=”); } if(feed[1] != “”) { return feed[1]; } else { return “”; } } var referrer=googleCookieReferrer(); if(referrer != null && referrer != “”) { if(readCookie(“__rfrr”)) { var feed = readCookie(“__rfrr”); var feed_temp = feed; var check = “”; feed = feed.split(“|”); if(feed[feed.length-1] == null) { check = feed; } else { check = feed[feed.length-1]; } if(check != referrer) { createCookie(“__rfrr”,feed_temp+”|”+referrer,365); } else { createCookie(“__rfrr”,referrer,365); } } }With this script in place, you can now answer questions like:

Which referrers generate the most sales, regardless of the click position (first, last, or intermediate)?

Which are the most effective first-click referrers in converting visitors?

Which referrers are most successful in bringing visitors back and converting them into customers?

A common query from clients using Google Analytics for e-commerce tracking is: Why do the numbers of money or orders shown by Google Analytics differ from actual figures? The reason lies in the fact that Google Analytics is not an accounting tool and does not provide exact sales figures. Issues like chargebacks, tracking code malfunctions, and incomplete e-commerce tracking across all payment methods are just a few reasons for the discrepancies.Here’s how to improve the situation:

Create a dedicated reporting page for sales in the website’s admin area (if one doesn’t already exist). Report on figures from your own database, including daily sales, orders, and average order value.

Implement the JavaScript hack (Example 1) to include referrer reports for your orders.

Integrate Google Analytics API queries to display behavior data of converted users compared to the website average, such as time spent on site, number of pages visited, or any other relevant metrics (key performance indicators or KPIs).

This approach will provide a professional dashboard that offers a clear, reliable view of your business’s performance.Personalizing the user experience can yield significant benefits. For instance, as reported by Fast Company, Yahoo!’s personalization algorithm was a key factor in a 270% increase in clicks on the homepage compared to 2009. Here are a couple of ways to personalize experiences for your visitors:

Display personalized messages and calls-to-action based on the referral path of your visitors. Start with targeted messages for users coming from advertising campaigns, offering exactly what they’re looking for based on the ad they clicked.

Modify your homepage content based on past behavior (opt-in or opt-out for visitors upon sign-up to respect privacy). Advanced coding may be necessary, but the results can be worthwhile.

Encourage engaged users to subscribe to your newsletter or RSS feed based on their behavior (using tools like PadiAct).

With the addition of this hack, you can display a bottom overlay to your visitors containing just the information they are looking for, which is a highly effective form of targeting.// Add this to extend the code in Example 1 function googleCookieKeyword() { var feed = readCookie(“__utmz”); if(feed.indexOf(“utmcsr”) == -1) { return null; } if(feed!=null) { if(feed.indexOf(“%7C”) != -1) { feed = feed.split(“%7C”); feed = feed[3].split(“%3D”); } else { feed = feed.split(“|”); feed = feed[3].split(“=”); } if(feed[1] != “”) { return feed[1]; } else { return “”; } } var referrer = googleCookieKeyword(); if (referrer == “YOUR_DESIRED_KEYWORD”) { // Add your code for displaying the content you desire here }Actionable web analytics should not be left to generic tools and standard data collection methods.It’s gratifying to know that it’s also not exclusive to large companies with substantial budgets. As long as you can engage in basic coding and are dedicated to achieving your website’s objectives, you can navigate through innovative solutions and workarounds. I hope this article has inspired you to delve deeper into enhancing the data gathered from your analytics software.

Search Analysis with Google Analytics

Hacking Google Analytics: Ideas, Tips and Tricks

Designing By Numbers: Data Analysis for Web Designers

Hacking Google Analytics: Ideas, Tips and Tricks

Using Charts and Graphs for Content

Chat With Us

If you need to do Google SEO screen blocking business, please contact me immediately

Share:

More Posts