Created
January 18, 2017 07:31
-
-
Save ajmorris/5f75e300eb9770416b7ca101db1d7fb4 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
<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