Created
April 22, 2019 17:24
-
-
Save GalloDaSballo/a731ec419c4222b61574859ef84e46e0 to your computer and use it in GitHub Desktop.
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
import React, {Component} from 'react' | |
import Helmet from 'react-helmet' | |
export default ({successOrderId, successAmount, successEmail}) => { | |
return ( | |
<Helmet> | |
<script> | |
{` | |
(function(){ | |
window['friendbuy'] = window['friendbuy'] || []; | |
const data = { | |
'id': '${successOrderId}', //INPUT ORDER ID | |
'amount': '${(successAmount / 100).toFixed(2)}', //INPUT ORDER AMOUNT //I assume this is 12 dollars | |
'email': '${successEmail}' //INPUT EMAIL | |
} | |
console.log("The Data", data); | |
window['friendbuy'].push(['track', 'order', data]); | |
console.log("Sent"); | |
(function (f, r, n, d, b, y) { | |
b = f.createElement(r), y = f.getElementsByTagName(r)[0];b.async = 1;b.src = n;y.parentNode.insertBefore(b, y); | |
})(document, 'script', '//djnf6e5yyirys.cloudfront.net/js/friendbuy.min.js'); | |
})() | |
`} | |
</script> | |
</Helmet> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment