leandrorc
leandrorc

Reputation: 21

Google Analytics and Facebook Pixel aren't tracking all visits

I created a customized pageviews counter at my website, so i compared it with Google Analytics and Facebook Pixel data, and i noted they aren't tracking all the visits. Actually, GA is counting a lot less visits. However, i didn't identified a pattern. As an example, for page A, my counter show 34,010 pageviews, while GA shows 2,757. For page B, my counter shows 21,690, while GA shows 8,994. Facebook Pixel is counting fewer pageviews than GA. I also have Facebook pagelike plugin at the website. Here is my related code:

<head>
...
        <!-- Google Analytics -->
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

            ga('create', 'UA-33363893-1', 'auto');
            ga('send', 'pageview');
        </script>
        <!-- End Google Analytics -->

        <!-- Facebook Pixel -->
        <script>
            !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
                n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
                n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
                t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
                document,'script','//connect.facebook.net/en_US/fbevents.js');

            fbq('init', '1552520671727240');
            fbq('track', "PageView");
            <?php
            $p = $controller . ' - ' . $action;
            switch($p){
                case 'usuario - cadastrado':
                    echo "fbq('track', 'CompleteRegistration');";
                break;
            }
            ?>
        </script>
        <noscript><img height="1" width="1" style="display:none"
                   src="https://www.facebook.com/tr?id=1552520671727240&ev=PageView&noscript=1"
            /></noscript>
        <!-- End Facebook Pixel -->
</head>

<body>
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.5&appId=1494091077554768";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    </script>
    ...
</body>

Any help?

Thanks in advance!

Upvotes: 0

Views: 618

Answers (1)

J Brazier
J Brazier

Reputation: 884

No two trackers report exactly the same data. There are a number of reasons for this:

  • Definitional questions around what does and doesn't constitute a Page View, Session or User.
  • Different data aggregation methods; some platforms may induce sampling.
  • The position of the tracker on the page makes a difference: a tracker at the top of the page will receive more than one at the bottom (although yours seem pretty close together here).
  • Asynchronous code is used by some trackers and not others.
  • Not all browsers allow JavaScript, some trackers respond to this better than others.
  • Some people have blocking technology, which will likely notice some trackers and not others, and react differently to each (I believe Google has an understanding about Google Analytics and Ad Blocker).
  • Many trackers have opt-outs that people can have enabled.
  • Trackers often rely on cookies, which different people will have different settings for. Different trackers will use different types of cookies (3rd party vs 1st party) and some may rely on them more than others.
  • Spiders, bots and referral spam can cause a small amount of traffic that certain trackers may choose to filter out.

You should definitely check your implementation of these trackers on both pages; I recommend using Google Tag Manager, correctly placed immediately after the opening tag on each page, to deploy them all. This should make them give more similar results. However, you're never going to get the same numbers. You have to accept that each tracker does its own thing.

Upvotes: 1

Related Questions