Page 1 of 1

Embedding script in footer

Posted: 28 Jan 2022, 18:38
by JMM
Hello again, Karl.

I have no idea if it will work, but I have embedded some script in my footer:

Code
<script type="text/javascript" src="https://www.jenjo.family/content/custom/files/jmm/phpwebstat/pws.php?mode=js"></script>

<noscript><img src="https://www.jenjo.family/content/custom/files/jmm/phpwebstat/pws.php?mode=img" style="border:0; width:1px; height:1px" alt="noscript-img"></noscript>
Unfortunately, it doesn't seem to be working, as nothing is being logged (captured).

By looking at the above code, do you see any reason why it should not work?

Thank you in advance & have a great day.

Regards,
John

Re: Embedding script in footer

Posted: 28 Jan 2022, 23:24
by mjau-mjau
The PHP you have above loads correctly, but then that PHP tries to load another path which is wrong 404:
https://www.jenjo.family/stat/pws.php

See screenshot:
Image

For it to work, the path would have to be corrected. Also, I should mention that it's likely this statisitics script will only track/count visitors on their entry point, and not while traversing pages. X3 is technically a SPA (single-page application), and that's why pages load fast when you navigate from the menu. This also means that stats will only trigger from the first page load, but not when navigating pages. Code would have to be modified.

Re: Embedding script in footer

Posted: 30 Jan 2022, 06:50
by JMM
All is good with the script now, Karl, since you pointed out to me the problem with the incorrect subfolder.

Thanks again for your help.