Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimboobrien/455d5aa50e89dcc83f18d4c46c112704 to your computer and use it in GitHub Desktop.
Save jimboobrien/455d5aa50e89dcc83f18d4c46c112704 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
jQuery(document).ready(function($) {
var ref = $.cookie( 'affwp_ref' );
var visit = $.cookie( 'affwp_ref_visit_id' );
// If a referral var is present and a referral cookie is not already set
if( ref && visit ) {
// Fire an ajax request to log the hit
$.ajax({
type: "POST",
data: {
action : 'affwp_track_conversion',
affiliate : ref,
amount : '',
status : '',
description : '',
context : '',
reference : '',
campaign : '',
md5 : 'd41d8cd98f00b204e9800998ecf8427e'
},
url: affwp_scripts.ajaxurl,
success: function (response) {
if ( window.console && window.console.log ) {
console.log( response );
}
}
}).fail(function (response) {
if ( window.console && window.console.log ) {
console.log( response );
}
}).done(function (response) {
});
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment