Last active
December 21, 2015 18:29
-
-
Save chexton/6348215 to your computer and use it in GitHub Desktop.
install-vero-ecomm.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1. Install this on EVERY page in the header template, just before </head> | |
| <script type="text/javascript"> | |
| var _veroq = _veroq || []; | |
| _veroq.push(['init', { api_key: '0826fd9f355e27524590db76d0114186e17d5723'} ]); | |
| (function() {var ve = document.createElement('script'); ve.type = 'text/javascript'; ve.async = true; ve.src = '//d3qxef4rp70elm.cloudfront.net/m.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ve, s);})(); | |
| </script> | |
| //2. Install this below the above script on pages where you have the customer's email address. E.g. when they sign in | |
| // or when they enter their email in checkout. Replace the "EMAIL" field with their email, dynamically. | |
| <script type="text/javascript"> | |
| var email = "EMAIL"; | |
| _veroq.push(['user', { | |
| id: email, | |
| email: email | |
| }]); | |
| </script> | |
| //3. Track when a customer starts checkout | |
| <script type="text/javascript"> | |
| _veroq.push(['track', 'begins checkout']); | |
| </script> | |
| //4. Track when a customer completes checkout | |
| <script type="text/javascript"> | |
| _veroq.push(['track', 'completes checkout']); | |
| </script> | |
| //5. Track when a customer visits the home page | |
| <script type="text/javascript"> | |
| _veroq.push(['track', 'visits homepage']); | |
| </script> | |
| // Note that you can track other events as well. Just put them on a button or on a page and change the name of the event. Vero does the rest. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment