jimboobrien
9/20/2017 - 11:37 PM

gistfile1.txt

<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>