User Tools

Site Tools


new_rotation_troubleshooting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
new_rotation_troubleshooting [2017/04/14 12:03] – [Script does not count thumbs' CTR] adminnew_rotation_troubleshooting [2026/03/21 10:11] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Troubleshooting ====== ====== Troubleshooting ======
  
-===== Script does not count thumbs' CTR  =====+===== Does not count Hits =====
  
-First of all - check if it counts 'shows'. If not - make sure you have rot_in.php in your templates.+Traffic isn't being countedCheck these issues:
  
-If there are 'shows' but no clicks check that you have 'rotation parameter' in your links  like 12x34x5678).+1. **DNS mismatch** You're viewing server 1 in your browser but the domain is on server 2. Or your hosts file points to a different server. To verify: Create a test file (test.txton the server and access it from your browser to confirm you're on the correct server.
  
-If you have it check rewritesThere are could be some problems with custom rewrites. Easiest way to check it: clicks on any link and save response headersThere should be Set-Cookie field in response.+2. **Excessive caching** The web server caches pages before they reach the scriptWhen a request comes in, the server runs the script once, caches the result, then serves that cached version on future requests without running the scriptNo script execution = no hit counting.
  
-For version 50+:  +To check for caching
-  * You can adjust traffic count in rotation settings and switch off count for noref\nocookie while having only this type of traffic (just starting site for example)  +Create log.txt in the domain root with 666 permissions 
-  * you can also not count clicks from proxies and have a problem with [[Nginx]] when it counts all traffic as proxy+- In common.php (in your domain root), add: `file_put_contents('/full_path_to/log.txt', date("H:i:s"':' $_SERVER['HTTP_REFERER'], FILE_APPEND);
-  * If you use rot_in.php do not add 'http://wwwto src=... because it sets a cookie to www.your.domain.com, while you links may look like just domain.com/... ie without www. This prevents browser from sending cookie+- Visit your domain from another one (you can add it as trader) 
 +- Entries should appear in the log
  
 +This also lets you verify that traffic is actually arriving, since sometimes traffic looks normal but isn't being counted.
  
 +
 +3. You can enable debug out.php in the settings, open any page and look at the headers. There may be other signatures by which an idea of what's wrong might come.
 +
 +
 +===== Does not count CTR =====
 +
 +**Version 2.X**
 +
 +First, verify that impressions are being counted.
 +
 +If there are no impressions, check:
 +
 +- **System traders** - In rotation settings, you may have "noref" or "notrade" traders that don't count traffic
 +- **Proxy traffic** - All traffic might be detected as proxy (which isn't counted). Check the Home page for a proxy indicator
 +- **Cache issues** - No cache (skip_cache in URL) or insufficient cache can lose impression data
 +- **Cron domain** - Ensure you're passing the correct domain name when running cron
 +
 +**For clicks to count:**
 +1. Enable magic rotation OR ensure a rotation parameter is present in links.
 +
 +
 +Options you can check yourself:
 +
 +**Magic rotation : Https - passing referrer** Magic rotation counts clicks relying on referrer, if it is not passed - rotation is not counted. How to check: [[troubleshooting#how_to_view_http_headers]] we look at click headers. Must pass **full** referer, not just truncated to the domain.
 +
 +What to do: Google "https passing referrer" - the question will be fully explained.
 +
 +
 +Check for meta name="referrer" in your template
 +
 +<code>
 +# Meta tag:
 +The meta referrer tag is placed in the <head> section of your HTML,
 +and references one of five states, which control how browsers send referrer information from your site.
 +
 +The five states are:
 +
 +  1.  None: Never pass referral data
 +
 +    <meta name="referrer" content="none">
 +
 +  2.  None When Downgrade: Sends referrer information to secure HTTPS sites, but not insecure HTTP sites
 +
 +    <meta name="referrer" content="none-when-downgrade">
 +
 +  3.  Origin Only: Sends the scheme, host, and port (basically, the subdomain) stripped of the full URL as a referrer, i.e. https://moz.com/example.html would simply send https://moz.com
 +
 +    <meta name="referrer" content="origin">
 +
 +  4.  Origin When Cross-Origin: Sends the full URL as the referrer when the target has the same scheme, host, and port (i.e. subdomain) regardless if it's HTTP or HTTPS, while sending origin-only referral information to external sites. (note: There is a typo in the official spec. Future versions should be "origin-when-cross-origin")
 +
 +    <meta name="referrer" content="origin-when-crossorigin">
 +
 +  5. Unsafe URL: Always passes the URL string as a referrer. Note if you have any sensitive information contained in your URL, this isn't the safest option. By default, URL fragments, username, and password are automatically stripped out.
 +
 +    <meta name="referrer" content="unsafe-url">
 +
 +
 +</code>
 +
 +"Magic rotation - skip_cache" often a page is tested with the skip_cache parameter, in this case it won't count clicks, because clicks are saved in cache until cron and in this case they simply don't write.
 +
 +What to do: test without skip_cache
 +
 +
 +**Rotation parameter** if you count clicks through a rotation parameter and you have rewrites, then the rewrites might be configured so that the rotation parameter is not passed.
 +
 +How to check: make links without rewrite, enable headers [[troubleshooting#how_to_view_http_headers]] - there should be Click-count-action headers. If without rewrite they are there, but with rewrite they are not - this means the problem is that the rewrite doesn't pass parameters.
 +
 +
 +What to do: fix the rewrites so they pass the ref.
 +
 +
 +
 +
 +**Version 1.X**
 +
 +First you need to check that impressions are being counted. If there are no impressions - 99% there is no rot_in.php in the page templates.
 +
 +If there are only no clicks - check that the gallery links have a rotation parameter like 12x34x5678.
 +
 +If it's there too - the problem might be in the rewrites. To check you need to click on any thumb and check the headers (If you don't know what these are or how to check them - [[Troubleshooting]] section about headers). If there are no fields like Set-Cookie in the headers - it means the rewrites bypass out.php. Check the rewrites, compare with what's in the wiki.
 +
 +For version 50+:
 +  * might be that you only have noref traffic for example and in rotation settings clicks counting for this traffic is disabled.
 +  * might be that clicks counting from proxies is disabled, and nginx is incorrectly configured and determines all traffic as proxy [[Nginx]]
 +
 +
 +===== Rewrites does not work =====
 +
 +There might also be a variant "skim doesn't work right", "URLs don't work", etc. Currently the 2 most common web servers are nginx and Apache. Rewrites are written differently in them. Probably you wrote rewrites in .htaccess although you have nginx.
 +
 +You can check this simply by looking at headers of any request, you will see a line like
 +
 +  Server: nginx
 +
 +or
 +
 +  Server: Apache/2.....
 +
 +===== Does not show navigation =====
 +
 +Problem: we have some page with 2 tags: <thumb group=A num=1-10 and <thumb group=B num=1-10 A problem arises with navigation, because it's not clear which tags to use to count the maximum number of pages. In this situation navigation is not displayed.
 +
 +To fix this in 50 a page_main_tag parameter was introduced, so <thumb group=B num=1-10 page_main_tag=true in this option will count navigation by this tag.
 +
 +
 +
 +===== Does not test new thumb =====
 +
 +New thumbs are not being tested. This also applies if something somewhere is not displayed.
 +
 +95% of such questions arise when galleries belong to disabled sponsors\groups
 +
 +Also with groups you need to keep in mind that if a thumb is in group A and B, while group A is disabled, there can be 2 selection variants:
 +
 +1. Select all thumbs that are not in group A
 +2. select all from group B
 +
 +In the first case, considering that our gallery is in group A it won't be selected
 +In variant 2 - it will be, because it's in group B.
 +
 +So to be able to do both this way a division was made.
 +
 +- if the group is NOT specified then the selection goes by option 1
 +
 +- if the group is specified - then by option 2
 +
 +
 +===== Template does not work =====
 +
 +If something somewhere doesn't display, displays incorrectly, isn't visible, returns content not found, etc.
 +
 +Best to start with a minimum template check where there will only be working tags without html, this allows you to immediately see unclosed tags and other things. For this
 +
 +  * create a test template, for example test
 +  * content like this is test template
 +  * open without rewrite and without cache for example domain.com/scj/tube/?force_template=test&skip_cache=true
 +  * should display what you have in the test template
 +  * after that take pieces from the "non-working" template and add to the test - this way you find the place that doesn't work, works incorrectly, breaks after that, etc., in a word the piece that causes the problem.
 +
 +in 99% of cases you will understand what the problem is yourself, if not - create a forum topic, support will solve it.
 +===== Does not grab thumbs =====
 +
 +99% of problems can be identified by the grabber log.
 +To do this:
 +  - add one gallery that is supposedly not being grabbed
 +  - wait a minute for the grabber to process it
 +  - see what's in the gallery_grabber.log
 +
 +Important messages also sometimes appear in Script Messages (This is a menu item)
  
 ===== Can not parse template ===== ===== Can not parse template =====
  
-99% - you have an error in your template. If you take a careful look at the error 99% you'll find out what'wrongFor example, your are trying to include file that does not exists and so on.+In 99% of cases PHP code error in your template. If you carefully read what it says after "can not parse template" then usually it's written specifically what the code cannot do. And if you look carefully at the code - you immediately see what the problem is. 
 + 
 +If you don't see what the problem is then remove all PHP code from the template, then add it in pieces and open the page without cache, until we reach the moment when an error appears. So you will find which part of the code gives the error. 
 + 
 + 
 +===== No thumbs ===== 
 + 
 +No thumbs, wrong thumbs, etc. 
 + 
 +1. make the newest template, for example test, like 
 +<code> 
 +<thumb num=1-10> 
 +<!--GALLERY_ID--><br> 
 +</thumb> 
 +</code> 
 +2. open as scj/tube/?force_template=test 
 + 
 +if there are no entries then we check 
 + 
 +  * are sponsors\groups active 
 +  * are galleries active 
 +  * and, hit, are you looking at the right host, have never encountered that in hosts one thing, domain on another server, etc 
 + 
 + 
 +===== Tube Embeded Switch Rules does not work ===== 
 + 
 +Usually it looks like this: a link like out.php?url=http://domain/gallery/slug/index.html and it's supposed to work when you click on this link. But when you click on it the out doesn't know which tube this gallery is from because to understand that you need to process the rewrite (which Apache does) and find out the gallery slug, and then search for it in the database. 
 + 
 +By default this option works with direct links like http://domain/gallery/slug/index.html because here it enters the script immediately after the rewrite, which passes the slug 
 + 
 +What to do: 
 + 
 +1. simple option make links like out.php?slug=....&url=http://domain/gallery/slug/index.html so the script will get slug 
 + 
 +2. complex: if you don't want to change the URLs then in common.php parse your rewrite and set $_GET['slug'] = ... , then the script will again get the slug when clicking 
 + 
 + 
 +===== Tag \ template does not work ===== 
 + 
 +In most cases the template has a lot of everything except the actual tags\macros of the script, and understanding what'there, where rewrites are, how everything is built - takes a lot of time (if it's possible at all without hours of conversations about what where how and why it was done)So if something doesn't work you need to do the following. 
 + 
 +  * create a test template, for example test 
 +  * add script tags\macros therecertainly in clean form, for example, if you have in the template something like 
 + 
 +<code> 
 +<thumb num=1-10> 
 +and here 15 lines of html with PHP insertions 
 +</thumb> 
 +</code> 
 + 
 +then for the test template this needs to be changed to for example 
 + 
 +<code> 
 +<thumb num=1-10> 
 +<!--GALLERY_ID--> or some specific tag that doesn't work 
 +</thumb> 
 +</code> 
 + 
 +the point of action is to get the most clean template, without styles, overlays, popups, etc - only script tags. 
 + 
 + 
 +  * open the test template with the parameters you need, for example http://domain/?slug=...**&force_template=test** 
 +  * if you see the problem in the test template - it means the problem is in the script, send support the admin, the link with the test template and description of what exactly is wrong there 
 +  * if everything is ok in the test - it means the problem is somewhere in your html\php. For this you start adding your code to the test template in pieces until the error appears. In 99% of cases by this point you will already understand what the reason is. 
 +  * transfer script tags to the test template until you manage to reproduce the problem, then it will be clear what exactly the problem is, and if in the script - then it will be clear what specifically to fix 
 + 
 +===== CURL Timeout ===== 
 + 
 +When grabbing files curl downloads them (not the script), the message in the log is like Curl error: Operation timed out after. Default timeout for curl - 30 seconds. This is done so that some site can't intentionally "tie up grabbing" by delivering one file for 3 days conditionally. You can raise the timeout time for yourself. To do this in config.php you need to add 
 + 
 +  $config['CURLOPT_TIMEOUT'] = 60000; 
 + 
 +this is 60 seconds. 
  
-if you don't understand where the error is - try to remove all your php code from a template and then add it back in parts checking the result each time you add a new line. This way you can find out what causes the error. 
new_rotation_troubleshooting.1492171389.txt.gz · Last modified: (external edit)