Mobile app version of vmapp.org
Login or Join
Barnes591

: "PHP" is showing up in Browser + OS list in Google Analytics report PHP is listed as a browser in Google Analytics. 50 sessions have been created. Obviously Analytics data is collected via

@Barnes591

Posted in: #BrowserDetecting #GoogleAnalytics #Php #ServerSideScripting

PHP is listed as a browser in Google Analytics. 50 sessions have been created.



Obviously Analytics data is collected via Javascript executed in the visitor's browser so what is PHP (a server-side language) doing in this list?!

My own server is PHP and there is a server-side script that records certain Events by pushing data into GA. I checked the Events report and sure enough, there was the exact same number 50, as the number of Unique Events.



So we can safely assume that these stats are actually about hits on the GA API. But why are my own server-side requests to Analytics being bundled in with data which should be about the users? I look at the Browser + OS report to learn about my site's Users, surely mixing in information about my server-side requests to the API is misleading?! PHP is not one of my users browsers, it is my own server pushing user data into my Analytics account.

Is there a some parameters I can add to the API requests? Should I be capturing the User Agent string myself and passing that to the GA API? If so, do I then capture the IP Address, language et cetera, the never ending list of things GA records. Can I just tell GA not to include the information about which server is hitting the API but instead, just the information given to the API?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Barnes591

2 Comments

Sorted by latest first Latest Oldest Best

 

@Karen161

Sending a non-interaction parameter with the Event hit type seems to keep the sessions at 0. The only issue I see now is that the "New Users" column still has data in it. This does not affect the graph or the total number of hits/sessions/pageviews, but I wanted to note it.

The syntax for a non-interaction is 'ni' (boolean) where 1 is non-interaction, and 0 is interaction. I've just added this into all of my server-side event tracking with a default of true. This seems to have fixed most of the problem.

Here it is on the documentation page.

Hope this helps. It seems like not a lot of people are having this issue, so it's tough to find any clues/answers.

10% popularity Vote Up Vote Down


 

@LarsenBagley505

Very likely an automated script hitting your site and trigger analytics to fire. PHP can be a valid user agent, at least according to www.useragentstring.com/pages/useragentstring.php
I would drill down in to the PHP analytics and then view the location of those visitors, time on site, page views and more to try and determine if it's a script or person.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme