Skip to content

Instantly share code, notes, and snippets.

View chexton's full-sized avatar

Chris Hexton chexton

View GitHub Profile
@chexton
chexton / shopify.js
Created December 17, 2014 00:06
shopify.js
//
//--------
//1. Edit theme.liquid, add this before </head>. REPLACE THE API KEY AREA OF THIS SNIPPET
<script type="text/javascript">
var _veroq = _veroq || [];
_veroq.push(['init', { api_key: 'YOUR_API_KEY' } ]);
_veroq.push(['trackPageview']);
(function() {var ve = document.createElement('script'); ve.type = 'text/javascript'; ve.async = true; ve.src = '//getvero.com/assets/m.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ve, s);})();
</script>
{% if shop.customer_accounts_enabled and customer %}
@chexton
chexton / gist:3c12e395843168a1a69a
Created December 16, 2014 07:16
installing-basic-tracking-vero.js
//1. Put this code before </head>. Replace your API (login to Vero account to get it)
<script type='text/javascript'>
var _veroq = _veroq || [];
_veroq.push(['init', {api_key: "YOUR_API_KEY"}]);
(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. Put this code before </head>, after the code above. Replace the email and user's personal details
<script>
_veroq.push(['user', {
@chexton
chexton / install-vero-ecomm.js
Created December 7, 2014 06:11
install vero ecomm
// 1. Put this just before </head> on EVERY page where you know the customer's email address. Replace your API key and replace the email with THEIR email address
<script type='text/javascript'> var _veroq = _veroq || []; _veroq.push(['init', {api_key: "YOUR_API_KEY"}]); (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>
<script> _veroq.push(['user', {
email: 'REPLACE_WITH_CUSTOMERS_EMAIL'
}]);
</script>
// 2. Put this before </body> on this page only: http://pazar.ackare.com/checkout/delivery
<script>_veroq.push(['track', 'begins checkout']);</script>
@chexton
chexton / test-php.php
Last active June 28, 2017 10:50
test-php-jn
require_once('vero.php');
$v = new Vero("API_KEY");
$id_customer = 1234;
$email = 'chris@getvero.com';
$v->identify($id_customer, $email);
$v->track("Viewed product", array('id' => '1234567', 'email' => 'chris@getvero.com'), array('data1' => 'something'));
@chexton
chexton / rml.html
Created November 20, 2014 02:58
rml-install
// Install this: https://wordpress.org/plugins/wp-vero/
// Put on this page (http://realmoneylife.com/dashboard/) before </body>:
<?php $current_user = get_current_user(); ?>
<script>
_veroq.push(['user', {
id: "<?php echo $current_user->user_email; ?>",
email: "<?php echo $current_user->user_email; ?>"
}]);
_veroq.push(['track', 'viewed dashboard']);
@chexton
chexton / capture-leads.html
Created January 7, 2014 12:10
capture-leads.html
<script>
$(document).ready(function(){
$('#form').submit(function(e){
e.preventDefault();
// Get email
var email = $('#lr_email_c').val();
// Get other data, e.g. name
var last_name = $('#last_name').val();
@chexton
chexton / setup-js-unbounce.js
Created November 20, 2013 00:25
setup-js-unbounce.js
//1. Add this on the Unbounce page itself:
<script type="text/javascript">
var _veroq = _veroq || [];
_veroq.push(['init', {
api_key: 'YOUR_API_KEY' // UPDATE THIS FROM https://app.getvero.com/account
} ]);
(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. Add this on the form confirmation dialog box. I have made comments where you can update things:
@chexton
chexton / add-vero-unbounce-js.js
Created November 13, 2013 04:26
add-vero-unbounce-js.js
//1. Return to the 'Form Confirmation Dialogue' editor tab
//2. Click the Javascripts button in the bottom left of the editor
//3. Paste the tracking code into the scripts dialogue
//4. Name your script 'KISSmetrics Conversion Event'
//5. Choose 'Head' in the placement dropdown menu
<script type="text/javascript">
var getUrlParams = function () {
var params = {},
hash;
@chexton
chexton / gist:7443633
Created November 13, 2013 04:19
install-vero-ff.js
//1. Put this just before the </head> on every page:
<script type="text/javascript">
var _veroq = _veroq || [];
_veroq.push(['init', { api_key: '9b2607e356c1c38ec6fb7923b57ee238641c2165'} ]);
(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. Put this on your thankyou/completed checkout page:
<script>
@chexton
chexton / ambassador.rb
Created November 8, 2013 02:57
ambassador
email = 'christopher@getvero.com'
begin
url = "https://getambassador.com/api/v2/getvero/UPDATE/json/ambassador/get"
data = {
email: email,
email_new_ambassador: 0
}
response = RestClient.post url, data