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
function flatten = (arr = [], result = [], depth) => { | |
depth--; | |
for (var i = 0, length = arr.length; i < length; i++) { | |
var value = arr[i]; | |
if (depth > -1 && Array.isArray(value)) | |
flatten(value, result, depth); | |
else | |
result.push(value); | |
} |
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
/* | |
This code will live on every single page. | |
It is a replacement for manually adding static script tags | |
to each page and it informs the gftracker with all | |
the information it needs. Also, you are not limited to just | |
the 4 examples you provided in case you need to add more later. | |
*/ | |
function affiliate(id = '', product = '') { | |
var url = 'https://www.gftracker.com/rd/jpx.php', | |
get = { sid: 24, transid: id, event: product } |