Skip to content

Instantly share code, notes, and snippets.

@kylefox
Last active December 12, 2015 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylefox/4740422 to your computer and use it in GitHub Desktop.
Save kylefox/4740422 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// Cart data, such as token, user, and item details. (ex: @cart.to_json)
var params = {
item_count: 3,
total_price: 150,
cart_token: "57b4b4a28e16316cdd028bf6e23ae100"
};
// Additional parameters if this order is "completed".
<% if @order.complete? %>
params.status = 'paid';
params.order_number = "<%= @order.number %>";
<% end %>
granify.track(params);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment