====== User Vars ====== Track custom traffic metrics the script doesn't measure by default. Simple variant: **Will help you determine by choice: % of surfers who load images or % of surfers who have JavaScript + images enabled.** ===== If you need to determine % of surfers without images ===== You need to do the following: - Insert into the page - Enable in the admin panel cjsettings-> Layouts 'UserVars count (hourly), 'UserVars count (daily)' That's it, in the corresponding column you will see % of image loads. How it works: if the server has images enabled, the browser will try to load /scj/cgi/user.php. Then the script compares the number of hits from the trader with the number of loads of /scj/cgi/user.php and you get the number of users with images enabled. Note that if you place this code at the end of the page, the surfer may stop loading images before the browser reaches this image load. ===== If you need to determine % of surfers without JS ===== You need to do the following: - Insert into the page - Enable in the admin panel cjsettings-> Layouts 'UserVars count (hourly), 'UserVars count (daily)' That's it, in the corresponding column you will see % of surfers with JS. ===== Determine % of surfers without JS and images ===== You need to do the following: - Insert into the page - Enable in the admin panel cjsettings-> Layouts 'UserVars count (hourly), 'UserVars count (daily)' That's it, in the corresponding column you will see % of surfers who executed JS and loaded the image. ===== Advanced variant if you're not scared of the word JavaScript ===== A potentially very powerful system for fighting cheaters. Based on the fact that a cheater must fully emulate a browser to bypass this system. To make it work, include the following code in the page The meaning of this code is that it inserts a zero-height and zero-width image into the document (i.e., the user doesn't see it) which fetches /scj/cgi/user.php with a specific code that is calculated by JS. In the admin script it shows % of loads of this image relative to all traffic (Cnt), as well as % of loads with an incorrect code (Dis). Thus, a cheater must not only download the required image, but also execute JS to find out what the code should be. The code is configured in [[AutoAnticheat]] The script in this example generates the number 401, which is entered by default in the settings. So if user.php is loaded and code is not equal to 401 then the Dis percentage will increase. If you change the script and the number changes = logically you need to change it in the admin panel. Similarly, if you simply change the number in the admin panel without changing the script, you will get 100% Dis. You can modify the JS script, or the way user_in.php is called, so that it is as difficult as possible for a cheater to automatically determine it. ===== Page scrolling check ===== You need to do the following: - Insert the code - Enable in the admin panel cjsettings-> Layouts 'UserVars count (hourly), 'UserVars count (daily)' ===== Redirect for those who failed the check ===== When requesting user.php, a user_var cookie is set for the user, this can be used to redirect users who did not load images for example. To do this, in the settings set Settings - CJSettings - other : Traffic Check - Cheat Hit if cookie doesnt exists = user_var, and in system trades set direct skimming or url for trader cheat_clicks.