Last active
December 25, 2015 21:09
-
-
Save chexton/7040883 to your computer and use it in GitHub Desktop.
This file contains 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
<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'] ?>", | |
price: "<?php $product['price'] ?>" | |
}); | |
<?php } ?> | |
// Track the event with the product meta-data after you've got them in the array | |
_veroq.push(['track', 'begins checkout', {products: products}]); | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment