store URL global before we redirect

How about adding parameters to the URL you redirect to:

wp_redirect ( add_query_arg("utm_source", $thispage, get_permalink ( $post->ID ) ));

and then checking the parameter on the target page?