If you'd like to track your payers through the check out process and across domains, you'll need to contact our support team so we can enable that feature on your account. Once we have enabled that feature, you'll need to take the following actions:
Assuming you do not have Google Analytics installed on your site, you need to use the following 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', 'UA-XXXXXXXX-1', 'auto', {'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['app.moonclerk.com']);
ga('send', 'pageview');
</script>
If you do have Google Analytics currently installed, you'll need to update your existing code to refect the above configuration. Be careful not to duplicate the ga('create'...) call. This call should only exist once.
Notes:
* This will only work with Universal Analytics (analytics.js - the new version of Google Analytics), not Classic (ga.js - the old version of Google Analytics)
* You’ll replace the UA-XXXXXXXX-1 from above with your actual Google Analytics Tracking ID.
2) Log into your Google Analytics account and add 'app.moonclerk.com' to the Referral Exclusion List.
3) Log into your MoonClerk account. Go to the Google Analytics Integration Page. Make sure your Google Analytics Tracking ID is pasted into the first field.
4) In the Cross Domain Configuration section of the Google Analytics Integration Page on MoonClerk, click Yes to “Configure Cross Domain Tracking.”
5) In the enabled Cross Domain Configuration section:
* If embedding your checkout, paste the domain(s) that will host the embed.
* If linking to a checkout, paste your domain(s) that will link to the checkout
* If you are redirecting to your domain(s) after a successful checkout, paste your domain(s) that you are redirecting to.
* Do not place any prefixes to the domain. For example: example.com is correct but http://example.com is not.
* Separate multiple domains with a comma.
6) Click Save Credentials on the Google Analytics Integration Page of MoonClerk.
7) If you are embedding a payment form, find the embed code for that payment form. You will need to add extra code to the embed code. Put the code "track":['ga'] in the "opts" section. Below is the embed code for a payment form without this extra code:
<div id="mc1syxnnv46"><a href="https://app.moonclerk.com/pay/1syxnnv46">Test Form</a></div><script type="text/javascript">var mc1syxnnv46;(function(d,t) {var s=d.createElement(t),opts={"checkoutToken":"1syxnnv46","width":"100%"};s.src='https://d2l7e0y6ygya2s.cloudfront.net/assets/embed.js';s.onload=s.onreadystatechange = function() {var rs=this.readyState;if(rs) if(rs!='complete') if(rs!='loaded') return;try {mc1syxnnv46=new MoonclerkEmbed(opts);mc1syxnnv46.display();} catch(e){}};var scr=d.getElementsByTagName(t)[0];scr.parentNode.insertBefore(s,scr);})(document,'script');</script>
Here is the embed code for that payment form with the extra code:
<div id="mc1syxnnv46"><a href="https://app.moonclerk.com/pay/1syxnnv46">Test Form</a></div><script type="text/javascript">var mc1syxnnv46;(function(d,t) {var s=d.createElement(t),opts={"checkoutToken":"1syxnnv46","width":"100%","track":['ga']};s.src='https://d2l7e0y6ygya2s.cloudfront.net/assets/embed.js';s.onload=s.onreadystatechange = function() {var rs=this.readyState;if(rs) if(rs!='complete') if(rs!='loaded') return;try {mc1syxnnv46=new MoonclerkEmbed(opts);mc1syxnnv46.display();} catch(e){}};var scr=d.getElementsByTagName(t)[0];scr.parentNode.insertBefore(s,scr);})(document,'script');</script>
Use this updated embed code on your site.