Foundation/Metrics/Landing Page Tracking

From MozillaWiki
Jump to: navigation, search

These are the tracking requirements that should be in place before launching a landing page.

Webmaker Landing Pages

All landing pages should be hosted on, or a subdomain.

Measuring Traffic

Google Analytics

If GA is not included as part of an existing template, you need to add the following before the closing </head> tag:

 <script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-35433268-12']);
 _gaq.push(['_setDomainName', '']);
 (function() {
   var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
   ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Webmaker Referrer ID Tracking

If webmaker login is included in the page, the referrer ID (RID) tracking will be automatically available and no further action is needed.

If webmaker login is not included, we need to add the following script before the closing </head> tag:

 <script src="" async></script>

Optimizely Code

This could should go immediately after the opening <head> tag

 <script src="//"></script>

Measuring Conversions

Google Analytics Goal

  • Make sure Goal Tracking is setup for the thing this landing page is trying to achieve (e.g. user creates a new accounts). If we do not already have a goal for this particular conversion, follow this link and file a bug under Webmaker Metrics.

Optimizely Conversion Goal

  • Optimizely tests need to track an end conversion point to know which page/design/content variations has the biggest impact.
    • If this is a static page view (eg .../thanks.html) we just need to ensure that page includes the Optimizely code shown above.
    • If the goal is an interaction that could happen in multiple locations, or doesn't generate a pageview (for example creating a webmaker account in a modal window) we need to implement a custom conversion tracking goal. This is done via the webmaker-analytics bower module. See example below for email sign-ups.

For the email sign-up landing page

(As above) this page should already include:

  • Google Analytics
  • Webmaker RID
  • Optimizely

For tracking conversions we need to include:

After an email address is successfully saved, fire the following JS where appropriate in the existing script:

 analytics.event("Email Sign Up", {label: "Learn More About Webmaker"});

Donation Pages (

 See example code for tracking BSD traffic and conversions using GA and Optimizely