1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Difference between js and php tags in web analytics

Discussion in 'Programming' started by nekowai, Jan 5, 2018.

  1. #1
    I have a php script that has the ability to generate web analytics from several websites, all from a unique server.
    The tacking code is javascript based, something like:

    <script type="text/javascript">..jscode..</script>
    <noscript><image to track users with disabled javascript></noscript>
    Code (markup):
    I've noticed some traffic is not caught by code above (I've used php to generate a raw log of local traffic), some are clearly bot traffic, but others left me in doubt, so, my question is:
    Is it possible the users not being tracked by the js/noscript code are genuine human users or just bots/automated traffic?
     
    Last edited: Jan 5, 2018
    nekowai, Jan 5, 2018 IP
  2. phpmillion

    phpmillion Member

    Messages:
    145
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    45
    #2
    I don't get this part:

    image to track users with disabled javascript

    How can image track users?
     
    phpmillion, Jan 5, 2018 IP
  3. nekowai

    nekowai Well-Known Member

    Messages:
    256
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #3
    It's simple actuality, you point the image address to a php script location, that particular address will return the headers of a 1px image, in return, the script gets the information of the user requesting the image.
    You can't get as much information as the javascript, but the basic is there.
     
    Last edited: Jan 5, 2018
    nekowai, Jan 5, 2018 IP
  4. phpmillion

    phpmillion Member

    Messages:
    145
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    45
    #4
    Well, I guess we have the answer to your question then. Many visitors use different types of ad blockers these days, and most of them block such "images", so it's natural you get many visits, but not all of these visits get tracked. Beside that, there are tons of plugins (I use them too) that block all types of analytics scripts for privacy reasons. Hope that helps.
     
    phpmillion, Jan 5, 2018 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Welcome to why I think tracking scripts are BULLSHIT, and wonder what in blazes is so wrong with the information from your server logs (as easily processed by tools like analog or webalizer) that you even need ANY of that garbage in the first place.

    It's the province of SEO and marketing scammers who like to just have more numbers to make their bullshit look legit through more card-stacking hoodoo-voodoo.

    You want info about who's been visiting? READ YOUR BLOODY SERVER LOGS!

    ... and yes, it is possible for an adblock to block the script, but not SCRIPTING. As such that <noscript> might NEVER RUN! Well, not an inline script, but any externals it depends upon certainly.

    NOT that inline scripts should even EXIST since they're outdated, outmoded, we've been told for over a decade to stop using them, hence their being blocked if you deploy them on a website that has the CSP (content security policy) in place. JUST like style="", <style> and those stupid malfing halfwit onevent="" attributes!
     
    deathshadow, Jan 6, 2018 IP
  6. nekowai

    nekowai Well-Known Member

    Messages:
    256
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #6
    It can also be tracked using a php tag in case the tracking is made on the same server, do you have anything to say about it? :)
     
    nekowai, Jan 8, 2018 IP