News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

running a survey

Started by clivesmith, March 03, 2012, 05:39:02 AM

Previous topic - Next topic

clivesmith

I am not sure the best place to ask this but, I want to run a survey when someone leaves my website, I have found limesurvey which seems to do what I want but I do not know how to get it to run when someone leaves the forum. I know exit popups are frowned on but I would still like to run it. I think that limesurvey can be set to run once per user so I hope not to be a pest to my users.
I have found several "on exit" scripts but I cannot work out which file they should be run in or where to put the code to get the effect I want.
Can anyone help please

pkrack

I am sorry but i didnt got your point cleared.
     You want to redirect your users to survey page when they click logout ?

clivesmith

I do not mean when they logout, I want it more for people who come to the site but do not register, so I want it to run when they leave my site and go somewhere else. I have created an HTML page and when someone shuts down the page a popup appears, that is what I want tp do.

pkrack

That can be obtained through a javascript code. I am not a js expert but i have seen many ads types which popup when you click back button or close the page. So either search google for "js popup on back" etc or wait here. There may be developers who knows the code as its very simple

clivesmith

Thanks Pkrack,

I have the code I just do not know where to put it to get the effect I want

pkrack

You can place it in index.template.php of the theme which you are using . Themes can be found by going to themes directory via ftp . Index.template.php file contains the main header and footer which is served in whole site so i think thats the right place for it

clivesmith

I have a jscript which works, but I am still having a bit of a problem getting it to work. I am trying to put it in the index.template.php but I cannot get the position of the script correct, I think I have tried it in all of the functions, the one that works best is the template_html_above() just before the </head> ( to recap the popup should only work when the user leaves the site) in this position the script works correctly when I navigate using the "home", "help","search", "login" buttons to navigate but if I pick a forum (still in my site) I get the popup. any ideas ?

pkrack

Is it possible to use your js between <body></body> tags? If possible then you have to add this code in other page specific templates like login.template.php etc and remove it from index.template.php so it will not be present every where

Advertisement: