Extension, Fieldtype, Module

Developer
Supported

Popular - The Advanced View Counter for ExpressionEngine

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Notebleu

     

You must be logged in to post.

Difference between Popular view counter and Google Analytics?

General

mavrekh
mavrekh

We’ve been using the Popular module for a few months now and we are pretty happy with it. One thing that I’ve noticed is that there seems to be a significant difference between the view count returned by the Popular counter and the “Pageviews” shown by google analytics for some of our pages:

151 in GA vs 1635 in exp_popular for one page
161 in GA vs 1332 in exp_popular for another page

I understand that GA ignores such things as robot traffic and the Popular module does not, but I wonder if the difference here is too significant to be caused by robots alone. Am I missing something obvious in the module config etc.?

Thanks!

Misha

Notebleu
# 1
Developer
Notebleu

Thanks, Misha.  Popular can count views in two ways, by default it uses an extension hook in ExpressionEngine that is run each time the channel entries routine is fired by your website.  Using the extension, it’s possible to get multiple counts for the same page, for instance if you are using the exp:channel:entries loop more than once on that template. 

A more dependable way to get one count per view is to disable the extension for the channels you’re tracking (go to Add-ons > Extensions and click “Settings” next to Popular, deselect all channels in the “Allowed Channel Ids” multi-select)  and instead use the {exp:popular:track_view} tag in your template.  This will make sure only one count is fired per view of the template.  You can pass either the entry_id or the url_title for the entry you’re tracking as a parameter of the tag.  More documentation is here: https://notebleu.com/software/popular.

If you’d like me to take a direct look at the way you’ve implemented to optimize the Module, let me know.  I don’t know that the numbers will ever line up perfectly between Popular and GA, just because of the back server side vs client side processing of the counting mechanism, but hope this gets you closer.

mavrekh
# 2
mavrekh

Thanks for your quick response. I am actually using the {exp:popular:track_view} method (as per notebleu’s response here: https://devot-ee.com/add-ons/support/popular-the-advanced-view-counter-for-expressionengine/viewthread/14960 :) )
Is there any kind of filtering or additional setup I need to do to get these numbers to line up more closely? As of right now, our “five most popular posts” page is seriously off from what the management is seeing in GA, and they are wondering why.

Nine Four Ltd.
# 3
Nine Four Ltd.

@mavrekh did you ever get to the bottom of these issues?

Notebleu
# 4
Developer
Notebleu

Hi mavrekh and Paul,

So sorry about this, I missed the notification of the July message.  mavrekh, would it be possible for you to post or email me the template code you’re using?  Is it possible that {exp:popular:track_view} is inside of a loop in the template and thus being run multiple times for each page load?  {exp:popular:track_view} tracks a view each time ExpressionEngine is asked to parse a template, whereas Google Analytics relies on Javascript to execute, so I can understand why the two counts would be different, but I’m surprised to hear they are so different.

mavrekh
# 5
mavrekh

Thank you for getting back to me. The code looks as follows:

{exp:channel:entries channel=“news” limit=“1” url_title=”{segment_2}” status=“open” paginate=“both” track_views=“one”}
      {if no_results}{redirect=“404”}{/if}

      {exp:popular:track_view entry_id=”{entry_id}”}


.....lots and lots of HTML here….

{/exp:channel:entries}

With the limit and url_title (unique per channel) limitations this shouldn’t execute more than once per page, correct?

Notebleu
# 6
Developer
Notebleu

Thanks, mavrekh, I wonder if it could be traffic from search engine spiders and other bots (which would not hit the Google Analytics tracking) that is causing the uptick in numbers.  Would it be possible for you to share admin credentials so that I could take a look at the implementation and the way Popular is configured?  email: itsnicehere@notebleu.com

Nine Four Ltd.
# 7
Nine Four Ltd.

Hello Mavrekh, and Notebleu,

Did you ever resolve this?