Hi I would like to activate fancybox on my website every time someone comes to my site by clicking on google ads. Fancybox is usualy triggered by clicking on a link.
Is it posible and what would be the best way to do that?
Many thanks, Dino.
Asked
Active
Viewed 229 times
0

dinodsaurus
- 4,937
- 4
- 19
- 24
-
You could check via cookie if the referrer site is Google ads or not... then launch fancybox accordingly. Check http://stackoverflow.com/a/2485971/1055987 for more. – JFK Sep 06 '12 at 00:01
2 Answers
0
I don't know the technicalities behind Google ads and what information you get server/browser-wise to indicate that someone has visited your site through Google ads; however, using jQuery and the following code would load fancybox when the page loads.
$(function(){
$('#my-element').fancybox();
});

Drew
- 462
- 2
- 8
0
If your AdWords account is linked to Google Analytics, then you could check for the presence of the gclid
parameter.
Alternatively, you could just add a query parameter to the destination URL, then pick it up in your JavaScript.

Ewan Heming
- 4,628
- 2
- 21
- 20