I'm trying to create a javascript tracker that can be included on any page, that will pass the variables "ref" and "aff" from the URL to the PHP code that does the tracking.
This code works perfectly for my purposes on PHP pages:
<script type="text/javascript" src="//www.foo.com/reftracker.php?ref=<?= $_GET['ref'] ?>&aff=<?= $_GET['aff'] ?>">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.foo.com/reftracker.php?ref=<?= $_GET['ref'] ?>&aff=<?= $_GET['aff'] ?>"/>
</div>
</noscript>
The issue is that I also need to add the tracker to non-PHP pages, so I need a pure Javascript solution to pass those URL parameters into src attributes.
Aucun commentaire:
Enregistrer un commentaire