Blog

We’ve explored many uses and applications of Google Analytics including understanding your customers through behavioral flow reporting and running semi-automated tasks by using a solution that applies JavaScript inside the Google Chrome Console. We even wrote an ebook on Google Analytics Tricks for Conversion Rate Optimization. Now let’s look at at how certain Google Analytics features can be used in applications outside of their initial intended purposes.

5 Alternate Uses for Google Analytics FeaturesFor example, user engagement can be measured via page depth and advanced segments. Intelligence alerts can be used to send yourself a text message if your website goes down. Your implementation can be debugged in real-time, rather than the usual 24 hours, by using real time content reports and unique query string parameters. For step-by-step instructions on alternate uses of these Google Analytics features and two others, check out the latest article, Creative Uses to 5 Google Analytics Features by Dave Fimek, Senior Consultant, Cardinal Path, on online-behavior.com.

 

Featured image source: Pixbay

tape-measureIt’s relatively easy to measure and evaluate ecommerce sites that have easily-identifiable conversions, but what about websites that don’t sell products?  We explored estimating ROI on non-ecommerce sites that have online forms for users to complete, but what about websites that don’t have any conversion opportunities for its visitors?

Those sites are more common than you might think, global brands in consumer packaged goods, energy, financial services, and other industries have websites where opportunities for conversion are very rare. Chanel.com for example lets users read about and look at their products but does not have a “Buy Now” or “Add to Cart” button anywhere.

So in the absence of concrete conversions, how do we measure engagement in a meaningful way?  Check out Marketing Land’s column A New Approach to Measuring Engagement on Content-Heavy Sites for a solution that adds appropriate weights and scores to different actions that users may take on a website. This approach gives marketers and analysts more specificity in measuring engagement and the ability to measure engagement as a continuous variable.

Read the whole article on Marketing Land

Recently, we helped a client to create a system to prevent double counting on web pages with iframes. Depending on your background and situation, you may have already been exposed to various workarounds via articles such as this one by Matt West. This article will additionally give you Google Analytics-specific tracking insights such as what to consider sharing between the frames to ensure proper marketing attribution depending on your specifications, and a link to a demo where you may view the source code.

Sample use case

Communicating between the parent and the iframe window, which may or may not share the same origin. Same origin simply refers to having the same protocol, hostname, and port number. Through proper communication, both parent and iframe components can retain their trackings as intended.

The solution

Below are the steps necessary to leverage the HTML5 function, postMessage, which allows cross-origin communication to dictate when to block pageviews from being fired from either the parent, or the iframe window. In either case, before we block either window’s pageview event, setup the following identifications:

  • Identify a parent window if applicable
    • check if window is the top frame
      • var is_top_frame = (self === top)? true : false;
  • Identify an iframe window if applicable
    • one method is to check if an iframe belongs to a mapping of websites or webpages to their iframes. Leverage belongs to the parent properties such as window.name
    • another method is to simply check if window is in a frame when circumstances permit
      • var is_iframe = (self !== top)? true : false;

To block the parent pageview from firing:

  • iframe window sends a message to parent window once the iframe window confirms that it should talk to the parent window
  • parent window validates message from iframe window by both discarding messages from unexpected origins and unexpected message format
  • parent window reads message and blocks pageview
  • if necessary, parent window can also respond back to iframe window

To block the child pageview from firing:

  • iframe window simply needs to identify itself from a list of iframes-to-block for the particular parent window where it resides
  • block pageview if the above is true

Google Analytics Caveats

Without any intervention, an iframe window will not be able to identify much of the parents’ inheritance such as referral and campaign data. To get around this, the iframe window can access the parent window’s attributes either from receiving messages from parents, or via the window parent property, for example:

  • parent_referrer = parent.document.referrer
  • parent_href = parent.location.href
    • Don’t forget the Google Adwords ID and Google Display Ads ID from the URL if applicable

Once the data missing from iframe are passed in messages from the parent frame, parse through the messages to get what you need. For instance, through the parent_href, parse through to retrieve all of the utm parameters and Google IDs if present. Then set the applicable GA parameters before sending a pageview.

Basic codes

The essential sample codes that we will be using to listen and send instructions.

Iframe window code to receive message from Parent

function pm_listener(event) {
      if (event.origitn == 'parent.origin') {
            if (event.data == 'Parent msg') {
                  event.source.postMessage('Parent msg received', event.origin);
            }
            else {
                  alert(event.data);
           }
     }
}
window.addEventListener('message', pm_listener, false);

Parent window code to send message to iframe window
var iframe_window = document.getElementsByTagName(‘iframe’)[0].contentWindow
iframe_window.postMessage(‘Parent msg’, ‘iframe.origin’);

Demo

Here is a demo of the technique we’ve shown between two different github subdomains.
Open up the developer console to see the string of messages passed between the parent and iframe windows. Also, feel free to change the utm parameters set, and call the page from a different source, so that you may view the campaign and referral data accordingly in the network traffic of the pageview sent by the iframe.

iframe-communication-messages-console

Next Steps

As mentioned earlier, there are a couple of workarounds to circumvent the same origin policy. Below are two other methods you can experiment with.

  • cross subdomain tracking
    • iframe can leverage document.domain to identify itself as the parent’s domain
  • cross domain tracking
    • use window.postMessage

Happy tracking!

We hear the jargon at every conference: predictive, programmatic, personalization, lifetime value, DMPs, right-message-right-person-right-time and so on. Little wonder then that marketers get discouraged—those desirable end-states often seem so far from where the organization is today. Too often the gap between untrusted data and real decision-making seems insurmountable. And marketers revert to the old-fashioned way of doing things: by gut. Or at least so it is suggested in a recent survey by The CMO Survey (pdf).

Marketing Technology Explostion
image source: v_alex, iStock photos

Everyone knows there’s no shortage of data being collected about customer interactions with digital properties—and plenty of other (sometimes off-line) data as well. Most of it remains segregated and unused because the technology needed to integrate the data in meaningful ways is not adequately deployed.

Data Activation is about waking your analytics data from its siloed slumber and connecting it to other data (and systems) you already have. In order to achieve “predictive” analytics, you need to have reliable data, make sure it’s integrated with as much additional data as possible, and connected to a real-time technology that allows you to build audiences and target them with pre-loaded messaging. There are lots of moving pieces here, and like many successful efforts, success depends on starting at the beginning and working through each detail carefully while keeping an eye on the goal.

This requires a skillful combination of strategy and tactics: the ability to define desired outcomes for the business, and the technical ability to execute each collection-point and integration along the way.

With the right people and the right plan, you can execute a repeatable process, using the right platforms, to get to an advanced state of data activation. Or, you could go to one more conference and listen to more jargon while your competitors become more agile every day.

For a lively discussion of data activation, a list of pre-requisites needed before data can be activated, and a data activation case-study please view our on-demand webinar: Activate Marketing Data, Drive Revenue — How to Deliver on the Promise of Digital Analytics.

Continuously dropping advertising rates are the reason why so many print magazines and newspapers are struggling and disappearing from the media landscape. Publishers themselves have played a big role in the decline of ad prices by not making enough of an effort to track data about their sites’ visitors. Life saverSince the ad networks that control most of the available advertising real estate don’t share enough analytics data with publishers for them to understand which of its pages are most valuable, the publishers are left a weaker position to argue the value of their content.  This forces them to give more visual space to advertising, which in turn drives the price of ads down even further.

For a deeper understanding of the relationship between publishers and ad networks and its role in declining ad prices, read the complete article on ClickZ: How Can Publishers Use Analytics Data to Save Themselves?

Ad blockers might be just as daunting to publishers as dropping ad prices; our blog post on ad blocking contains advice on how to start planning for a future in which ads will be blocked easier and more often than in the past.

Web Analytics

Five Alternate Uses for Google Analytics Features

We’ve explored many uses and applications of Google Analytics including understanding your customers through behavioral flow reporting and running semi-automated tasks by using a solution that applies JavaScript inside the Google Chrome Console. We even wrote an ebook on Google Analytics Tricks for Conversion Rate Optimization. Now let’s look at at how certain Google Analytics … Read Full Post

How to measure engagement on websites without conversions

It’s relatively easy to measure and evaluate ecommerce sites that have easily-identifiable conversions, but what about websites that don’t sell products?  We explored estimating ROI on non-ecommerce sites that have online forms for users to complete, but what about websites that don’t have any conversion opportunities for its visitors? Those sites are more common than … Read Full Post

Communicating with iframe for Google Analytics

Recently, we helped a client to create a system to prevent double counting on web pages with iframes. Depending on your background and situation, you may have already been exposed to various workarounds via articles such as this one by Matt West. This article will additionally give you Google Analytics-specific tracking insights such as what … Read Full Post

Data Activation

We hear the jargon at every conference: predictive, programmatic, personalization, lifetime value, DMPs, right-message-right-person-right-time and so on. Little wonder then that marketers get discouraged—those desirable end-states often seem so far from where the organization is today. Too often the gap between untrusted data and real decision-making seems insurmountable. And marketers revert to the old-fashioned way … Read Full Post

How can publishers use their analytics data to save themselves?

Continuously dropping advertising rates are the reason why so many print magazines and newspapers are struggling and disappearing from the media landscape. Publishers themselves have played a big role in the decline of ad prices by not making enough of an effort to track data about their sites’ visitors. Since the ad networks that control … Read Full Post

Benchmark Your Marketing Analytics Maturity

See how your marketing analytics performs against thousands of organizations. (Approx. 5 minutes).