Answer the question
In order to leave comments, you need to log in
How to run a script with the condition that the page was visited from another site?
There is a script
<script>
$(document).ready(function() {
if (YMaps.location.city != '') {
var youRegion = (YMaps.location.city);
if (youRegion === "Екатеринбург"){
setTimeout(function(){(Image ? (new Image()) : document.createElement('img')).src = location.protocol + '//vk.com/rtrg?r=ecPI*kK4/oqgC0i5tI5rhw6KUcrjXxV7JlAoaLB2cMqJrcyvMXi9YSqeN2Y/RFBz925QNz1suYZKQ8QiO0uMEeM25hZlfhvhuUkU7C6kVD/Hkv11/ouv48EfbJdKJ2nPeo51wIdPMyy2j6d9DEtA63*PjszmFjfZNucc94G6TRY-';}, 19000);
setTimeout(function(){_tmr.push({ id: "2692689", type: "reachGoal", goal: "test" });}, 19000);}
else{}
}
});
</script>
Answer the question
In order to leave comments, you need to log in
document.referrer
contains the address from which the transition to the current page was made. Check it for a mismatch with the current domain and do what you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question