Foundation/Metrics/Landing Page Tracking: Difference between revisions

Jump to navigation Jump to search
Line 60: Line 60:
   analytics.conversionGoal("WebmakerEmailSignUp");
   analytics.conversionGoal("WebmakerEmailSignUp");
</code>
</code>


== Donation Pages (sendto.mozilla.org) ==
== Donation Pages (sendto.mozilla.org) ==
Line 99: Line 100:


* We need to replace the revenue value with the donation amount in USD '''Cents''' [https://ecommerce.shopify.com/c/ecommerce-marketing/t/implementing-the-optimizely-revenue-tracking-code-with-shopify-178751 Optimizely Documentation]
* We need to replace the revenue value with the donation amount in USD '''Cents''' [https://ecommerce.shopify.com/c/ecommerce-marketing/t/implementing-the-optimizely-revenue-tracking-code-with-shopify-178751 Optimizely Documentation]
== Localized PayPal Donations ==
=== Measuring Traffic (donation forms and thank you pages)===
==== Google Analytics ====
<code>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35433268-5']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</code>
=== Conversions (thank you pages)===
==== Google Analytics Ecommerce ====
This appears anywhere on the thank you page '''after''' the standard tracking code above ^^.
<code>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_set', 'currencyCode', '__CURRENCYCODE__']); // Set to user currency
  _gaq.push(['_addTrans',
  '__TRANSACTIONID__',          // transaction ID - required
  'Donations',  // affiliation or store name
  '__TOTAL__',          // total - required eg '10.50'
  '0',          // tax
  '0',              // shipping
  ]);
  _gaq.push(['_addItem',
  '__TRANSACTINID__',          // transaction ID - required
  'PPLocalDonation',          // SKU/code - required
  'PayPal Donation',        // product name
  'PayPal Donation Local Currency',  // category or variation
  '__TOTAL__',          // unit price - required e.g. '10.50'
  '1'              // quantity - required
  ]);
  _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
  </script>
</code>
The variables required here are passed back from PayPal in the URL:
  example/thankyou/page/?'''tx=7Y832264R8070530T'''&st=Completed&'''amt=3.00'''&'''cc=USD'''&cm=&item_number=&sig=hVRnU66cJBDBfsEZBdHWHpUQSPfp0Sq2Qe3z4wdHy9kQ5ZpwmClbFSXupMZWjmkZI8WhoU7z185z96EKOHbpiU+/mtUSTjP0mkIHqC1seBOqbG0Wzdh4Ll02YlkU9Y96Hp6nnstJliWm4zaLfHkn0UqKJWJsQ7A6JmN1cx6rpwk=
Confirmed users
402

edits

Navigation menu