Created
July 17, 2023 12:21
-
-
Save xlplugins/26fe7f199b5339a813b5531a61fd4cff to your computer and use it in GitHub Desktop.
Voluum script with click ID
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
/** | |
* Rendering Custom tracking script for thank you and upsell pages. | |
* | |
* @param $general_data | |
*/ | |
function render_custom_script_tracking( $general_data ) { | |
?> | |
<script type="text/javascript"> | |
if (undefined !== wfocu_tracking_data && '' !== wfocu_tracking_data) { | |
let order_id = ''; | |
if ("undefined" !== typeof wfocu_tracking_data.ga_transaction_id && '' !== wfocu_tracking_data.ga_transaction_id) { | |
order_id = wfocu_tracking_data.ga_transaction_id; | |
}else if ("undefined" !== typeof wfocu_tracking_data.transaction_id){ | |
order_id = wfocu_tracking_data.transaction_id; | |
} | |
var wffnclickID = '<?php isset($_COOKIE['bwf_clickid']) ? $_COOKIE['bwf_clickid'] : ''; ?>'; | |
var wffntotal = wfocu_tracking_data.total; | |
(function(a,b){a="https://log.superceramiccoating.com/conversion.js?cid="+wffnclickID+"&payout="+wffntotal+"";var c=b.createElement("script"),d=b.scripts[0];if(b=b.cookie.match(/(^| )vl-cid=([^;]+)/))if(-1<a.indexOf("cid="))a=a.replace(/cid=.*?(&|$)/,"cid="+b.pop()+"&");else{var e=-1<a.indexOf("?")?"&":"?";a+=e+"cid="+b.pop()}c.src=a;d.parentNode.insertBefore(c,d)})(window,document); | |
} | |
</script> | |
<?php | |
} | |
add_action( 'wfocu_custom_purchase_tracking', 'render_custom_script_tracking' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment