Created
January 7, 2015 10:56
-
-
Save koenbok/44c5e2769fbbc1fc9044 to your computer and use it in GitHub Desktop.
GoSquared FastSpring
This file contains hidden or 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
| <!-- start gosquared --> | |
| <div> | |
| <script> | |
| !function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push( | |
| arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0]; | |
| d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode. | |
| insertBefore(d,q)}(window,document,'script','_gs'); | |
| _gs('GSN-181913-K'); | |
| </script> | |
| <script> | |
| function convertUSD(value) { | |
| console.log("convertUSD:", value); | |
| return parseInt(value.replace(/\D+/g, '')) / 100; | |
| }; | |
| _gs('transaction', '#{order.id}', { | |
| revenue: convertUSD("#{order.subTotalUSD}"), | |
| // quantity: 10, | |
| track: true | |
| }, [ | |
| <repeat value="#{order.allItems}" var="orderItem"> | |
| { | |
| name: '#{orderItem.productName}', | |
| price: convertUSD("#{orderItem.priceTotalUSD}"), | |
| quantity: #{orderItem.quantity} | |
| } | |
| </repeat> | |
| ]); | |
| </script> | |
| </div> | |
| <!-- end gosquared --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment