When setting up the Google Analytics integration at RaiseDonors, you have the ability to completely customize the code integrating with Google Analytics.
Please note, we cannot provide support with the Advanced Google Analytics integration. We do encourage you to checkout the helpful plugin with Chrome, which allows you to see what is happening in the Google Analytics integration.
Do not use this feature to place other custom javascript snippets, ie: Facebook Pixels, Google Tag Manager, etc. If you need to include other javascript snippets, you can accomplish that per campaign using the 'custom javascript' feature found in the page builder OR you can use the Global Script manager.
Landing Page Code
For the Landing Page Code, you'll want to head over to your Google Analytics profile and get your tracking code. This can be either Google's "Legacy" code or the newer "Universal" code.
Please note: When setting up your Google Analytics integration in RaiseDonors, you have the option of "Simple Mode" and "Advanced Mode". When you select Advanced Mode, we’ll pre-populate the entries for you with these code templates.
Universal Code
< script > (function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []) .push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'REPLACE_GOOGLE_ANALYTICS_ACCOUNT_ID', 'auto'); ga('send', 'pageview'); < /script>
Legacy Code
Please be sure to replace “your-domain.org” with the domain name of your organization. ex: cnn.com (no "http://" or "www").
< script type = "text/javascript" > var _gaq = _gaq || []; _gaq.push(['_setAccount', 'REPLACE_GOOGLE_ANALYTICS_ACCOUNT_ID']); _gaq.push(['_setDomainName', ‘ { your-domain.org }’]); _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>
Tokens for Landing Page Code
See our list of available tokens here.
"Thank You Page" Code
The basic structure for the Thank You Page is to include the same code from the Landing page and add in the e-commerce code. We’ve provided our own implementation here, but feel free to customize as you see fit.
Universal with E-Commerce
https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
< script >
(function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []) .push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'REPLACE_GOOGLE_ANALYTICS_ACCOUNT_ID', 'auto'); ga('send', 'pageview'); ga('require', 'ecommerce', 'ecommerce.js'); ga('ecommerce:addTransaction', { 'id': ‘REPLACE_DONATION_ID’, // Transaction ID. Required. 'affiliation': ‘REPLACE_ORGANIZATION_NAME’, // Affiliation or store name. 'revenue': ‘REPLACE_DONATION_TOTAL_AMOUNT’, // Grand Total. 'shipping': '0.00', // Shipping. 'tax': '0.00' // Tax. }); ga('ecommerce:addItem', { 'id': ‘REPLACE_DONATION_ID’, // Transaction ID. Required. MUST BE IDENTICAL TO TransactionID Above (‘addTransaction’) 'name': 'REPLACE_ORGANIZATION_URL // REPLACE_PAGE_TITLE', // Product name. Required. 'sku': 'REPLACE_PAGE_ID', // SKU/code. 'category': 'REPLACE_ORGANIZATION_URL', // Category or variation. 'price': 'REPLACE_DONATION_TOTAL_AMOUNT', // Unit price. 'quantity': '1' // Quantity. }); ga('ecommerce:send');
< /script>
Legacy with E-Commerce
Please be sure to replace “your-domain.org” with the domain name of your organization. ex: cnn.com (no "http://" or "www").
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce
< script type = "text/javascript" > var _gaq = _gaq || []; _gaq.push(['_setAccount', 'REPLACE_GOOGLE_ANALYTICS_ACCOUNT_ID']); _gaq.push(['_setDomainName', 'your-domain.org']); _gaq.push(['_trackPageview']); // Google E-commerce LEGACY add-in _gaq.push(['_addTrans', 'REPLACE_DONOR_FNAME REPLACE_DONOR_LNAME_ REPLACE_RANDOM_NUMBER’, // transaction ID - required ' REPLACE_ORGANIZATION_NAME Donation ', // affiliation or store name ' REPLACE_DONATION_TOTAL_AMOUNT ', // total - required ' 0.00 ', // tax ' 0.00 ', // shipping ' REPLACE_DONOR_BILLING_CITY ', // city ' REPLACE_DONOR_BILLING_STATE ', // state or province ' REPLACE_DONOR_BILLING_COUNTRY ' // country ]); _gaq.push([' _addItem ', ' REPLACE_DONOR_FNAME REPLACE_DONOR_LNAME_ REPLACE_RANDOM_NUMBER ', // transaction ID - required ' REPLACE_PAGE_PROD_CODE ', // SKU/code - required ' REPLACE_PAGE_TITLE ', // product name ' REPLACE_PAGE_TITLE ', // category or variation ' REPLACE_DONATION_TOTAL_AMOUNT ', // unit price - required ' 1 ' // quantity - required ]); _gaq.push([' _trackTrans ']); //submits transaction to the Analytics servers (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>
Tokens for Thank You Page Code
See our list of available tokens here.