We cannot seem to figure out how come the conversions are not firing back on an eCommerce store. Errors show cid value is null. (we record only 20% of the conversions so something is broken somewhere but not too broken either which is frustrating)
Anyone noticed something missing?
Our offer page is domain.com/page1/?cid={clickid} and we have a prelander .
Thank you page (after payment) runs this script
<?php
if(!isset($_GET['status']) && $_GET['status'] != 'success')
{
wp_redirect( home_url() );
exit;
}
if(isset($_GET['status']) && $_GET['status'] == 'success')
{
$orderdata = $_SESSION["orderdata"];
if(count($orderdata) > 0)
{
change_user_tag_id($orderdata);
$_SESSION["orderdata"] = '';
unset($_SESSION["orderdata"]);
}
}
get_template_part( 'templates/parts/global/head' );
if (isset($_COOKIE["volCid"])) {
$volCid = $_COOKIE["volCid"];
} else{
$volCid = 'false';
}
?>
<script type="text/javascript" src="https://voluumdomain.com/postback?cid=<?php echo $volCid; ?>"/></script>
Not sure based on the code above... the php looks ok (I'm not a php expert though). And it looks like it should work as long as the cid token is being passed into the url correctly.
Looking closer at that last line in your code... you're using script src to load your
<script>
var uniqueCID = "<?php echo $volCid; ?>";
var postbackURL = "https://voluumdomain.com/postback?cid=" + uniqueCID;
// then we have some sort of function to call that combined URL
function postThatBack(){
window.onbeforeunload=null,window.location=postbackURL
};
//then we can call that function to make sure it's actually happening
postThatBack();
</script>
Let me tah @Voluum guys here, they should be able to help.
Two queries I have with your code
You’re trying to pull a stores CID from a a cookie. I’d expect though you are setting this cookie on the initial page they visit. Can you check there is a code there for this? Setting it as a session value would be better.
The token your passing it through as is cid, so your cookie example uses volcid, so I’d double check your variable names are consistent
Unless the volcid is already being grabbed from GET and then being set into a cookie on the landing page, then after checkout, that cookie is called on the thank you page.
Of course, it'd be a lot easier to just pass the same token into the url for checkout and thank you pages and grab it again.
But I don't exactly know the setup, I'm just guessing here 
Thanks guys.
@nickpeplow
We have this in our home page, which should answer both queries yeah?
<?php
$cid_id = $_GET['cid'];
if (isset($cid_id)) {
setcookie("volCid", $cid_id);
}
?>