Answer the question
In order to leave comments, you need to log in
How to save the path from contextual advertising on all pages of the site?
good afternoon! please tell me how to make a person who switched from Google contextual advertising, for example, walk around the site, but /?gclid=... would be saved in the url, no matter what folder of the site he looked into?
wrote the code
<?
if (!empty($_REQUEST['gclid'])) {
$IGOG=$_REQUEST['gclid'];
session_start();
$paramsession2=$IGOG;
$_SESSION[$paramsession2] = $IGOG;
?>
<?
if(strpos($_SESSION[$paramsession2]) !== false){
?>
<span>Вы перешли с контекстной рекламы</span>
<?
}
}
Answer the question
In order to leave comments, you need to log in
$(document).ready(function() {
var params = window.location.search.replace(/\+/g, '%20');
$('a').each( function(i) {
if (this.href.indexOf('?') == -1) {
this.href = this.href + params;
} else if (params.length) {
this.href = this.href + '&' + params.substr(1);
}
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question