Skip to content

Instantly share code, notes, and snippets.

View chexton's full-sized avatar

Chris Hexton chexton

View GitHub Profile
@chexton
chexton / vero_add_to_cart.php
Created November 26, 2012 05:40
Vero Pro Training Add To Cart
<?php
if ( isset( $_POST['products'] ) )
{
foreach ( $_POST['products'] as $product )
{
?>
<script>
_veroq.push(['track', 'added_product_to_cart', {id: '<?php echo $product['product'] ?>', price: '<?php echo $product['price'] ?>', category: '<?php echo $product['category'] ?>'}]);
</script>
<?php
@chexton
chexton / cart-test.php
Created November 27, 2012 03:44
Another Vero gist
<?php if(shopp('cart','hasitems')): ?>
<?php while(shopp('cart','items')): ?>
<script>
_veroq.push(['track', 'added_product_to_cart', {name: '<?php shopp('cartitem','name'); ?>', price: '<?php shopp('cartitem','unitprice'); ?>', url: '<?php shopp('cartitem','url'); ?>'}]);
</script>
<?php endwhile; ?>
<?php else: ?>
<p>There are no items in the cart.</p>
<?php endif; ?>
@chexton
chexton / thanks.php
Created November 27, 2012 04:01
vero protraining thanks
<?php while(shopp('purchase','items')): ?>
<script>
_veroq.push(['track', 'purchased_item', {name: '<?php shopp('purchase','item-name'); ?>', price: '<?php shopp('purchase','item-price'); ?>', qty: '<?php shopp('purchase','item-quantity'); ?>', download_url: '<?php shopp('purchase','item-download'); ?>'}]);
</script>
<?php endwhile; ?>
<script>
var items = [];
<?php while(shopp('purchase','items')): ?>
items.push({name: '<?php shopp('purchase','item-name'); ?>', price: '<?php shopp('purchase','item-price'); ?>', qty: '<?php shopp('purchase','item-quantity'); ?>', download_url: '<?php shopp('purchase','item-download'); ?>'});
<script>
_veroq.push(['user', {email: '<?php echo shopp('purchase','email'); ?>', first_name: '<?php echo shopp('purchase','firstname'); ?>', id: '<?php echo shopp('purchase', 'get-customer'); ?>'}]);
</script>
@chexton
chexton / vero-knotty-integration.js
Created December 5, 2012 21:32
Vero Knotty Integration Code
// Each line of code here is JS so you'd put it in <script></script> tags where required. I am going to leave these out for clarity :).
// 1. Track when someone signs up. Note when identifying a user you can record *any* attributes you want.
_veroq.push(['user', {email: 'customer-email@domain.com', first_name: 'first-name', last_name: 'last-name'}]);
_veroq.push(['track', 'signed_up']);
// 2. Track when someone signs in.
_veroq.push(['track', 'signed_in']);
// 3. Track when someone views a product
@chexton
chexton / practising-tax.js
Created December 6, 2012 01:04
Integration sample for PractisingTax
// Each line of code here is JS so you'd put it in <script></script> tags where required. I am going to leave these out for clarity. The first step is to add our library to your <head> tag, you can get this from you account at getvero.com/getting-started.
// 1. Track when someone signs up. Note when identifying a user you can record *any* attributes you want.
_veroq.push(['user', {email: 'customer-email@domain.com', first_name: 'first-name', last_name: 'last-name'}]);
_veroq.push(['track', 'signed_up']);
// 2. Track when someone signs in.
_veroq.push(['track', 'signed_in']);
// 3. Track when someone views a product
@chexton
chexton / noom-download-link.html
Created December 6, 2012 04:21
NOOM download link
@chexton
chexton / scriptrock-error.txt
Created December 12, 2012 23:14
Scriptrock Interactive Error
ScriptRock Application v1.3.0
Chriss-MacBook-Air:mailship chrishexton$ scriptrock version
ScriptRock Application v1.3.0
Chriss-MacBook-Air:mailship chrishexton$ scriptrock register
Please enter your ScriptRock credentials...
Email: chris@semblancesystems.com
Password: *********
@chexton
chexton / protraining-trial-subscription-code.html
Created December 13, 2012 03:27
Protraining Training Subscription Code
<script>
$(document).ready(function(){
$('[id^="nm_mc_button-"]').click(function(e){var email = $('[id^="EMAIL-"]').val();
var fname = $('[id^="FNAME-"]').val();
_veroq.push(['user', {"email": email, "name": fname}]);
_veroq.push(['track','trial_soccer_fitness_conditioning']);});
});
</script>
@chexton
chexton / luxurycases-integration.js
Created December 19, 2012 03:01
LuxuryCases integration
// Screw the other document I passed along. Here is the magic. EVERYTHING on this page goes between <script> tags when we move it to your site. I left them out for brevity.
// First step, whack this library in your header (just like Google Analytics): getvero.com/getting-started
// Second step, track when customers sign up, sign in, add email during checkout and subscribe to your newsletters (which you can also use our form builder for, getvero.com/tools/forms/new).
_veroq.push(['user', {id: 'replace-with-users-email', email: 'replace-with-users-email']);
// Third step, track these events.