Skip to content

Instantly share code, notes, and snippets.

View chexton's full-sized avatar

Chris Hexton chexton

View GitHub Profile
@chexton
chexton / hc-install.js
Created June 3, 2013 12:35
hc-install.js
//1. Grab first snippet of code from https://www.getvero.com/connect and copy paste into header file just before </head>
//2. Add the following code just after the code in step 1 (also in the header just before </head>)
<script>
email = 'customer@domain.com'; // Replace dynamically
_veroq.push(['user', {id: email, email: email}]);
</script>
//3. Put this on the product page template
<script>
@chexton
chexton / abandoned-cart.js
Last active June 30, 2020 06:30
abandoned-cart.js
//1. Grab the first snippet
<script type="text/javascript">
var _veroq = _veroq || [];
_veroq.push(['init', { api_key: 'ce8e305b4c762721725194840ec18fda4f97febd'} ]);
(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>
@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 / shopify.html
Created February 19, 2013 23:50
shopify.html
<!-- This script needs to be loaded on EVERY page via a Shopify ScriptTag (including the thankyou page) -->
https://www.getvero.com/assets/m.js
<!-- This script needs to be loaded on EVERY page via Shopify ScriptTag (including the thankyou page) -->
https://www.getvero.com/assets/shopify.js
<!-- xx -->
@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
<script>
var products = [];
<?php
var products = //Array of products
foreach ($products as $product) { ?>
// Add the product to the JS array
products.push({
name: "<?php $product['name'] ?>",