Note that there are some explanatory texts on larger screens.

plurals
  1. POTest Google Analytics from localhost
    primarykey
    data
    text
    <p>I've seen this: <a href="https://stackoverflow.com/questions/4375447/can-you-test-google-analytics-on-a-localhost-address">Can you test google analytics on a localhost address?</a> and <a href="https://stackoverflow.com/questions/10317190/getting-google-analytics-to-see-a-test-server">Getting Google Analytics to see a test server</a> followed what was suggested, but nothing works.</p> <p>What I did:</p> <ul> <li>Edited my hosts file to have several additional domains.</li> <li>Created virtual hosts on my local Apache httpd server.</li> <li>Created an account in Google Analytics, created several "properties" (as in websites that belong to me) in that account.</li> <li>Wrote a testing HTML page that would report a page view to the Google Analytic service.</li> </ul> <p>All listings are shown below:</p> <p><code>c:/Windows/System32/drivers/etc/hosts</code></p> <pre><code>127.0.0.1 ad-test # for testing ad banners 127.0.0.1 testing.foo.tv # for testing ad banners 127.0.0.1 testing.foo-sdk.tv # for testing ad banners </code></pre> <p>The relevant part of <code>httpd.conf</code></p> <pre><code>&lt;VirtualHost *:80&gt; ServerName ad-test DocumentRoot D:/cygwin/home/wvxvw/projects/AdModule &lt;Directory "D:/cygwin/home/wvxvw/projects/AdModule"&gt; AllowOverride All Order Allow,Deny Allow from all Require all granted &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p><em>(looks the same for all other hosts)</em></p> <p>The <code>AdModule</code> directory has the following <code>index.html</code> file:</p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt; &lt;script type="text/javascript"&gt; var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXX-3']); _gaq.push(['_setDomainName', 'none']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); &lt;/script&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p><em>(There is also a variation that uses newer API, but I'm not posting it for shortness)</em></p> <p>The <code>document.domain</code> property in the above HTML page is set to the domain I specified in the Google Analytics account settings.</p> <p>When I look at the requests sent to Google Analytics service, I can see the JavaScript being loaded and then the gif image, too. I can call other API functions w/o errors, but nothing gets displayed in the dashboard.</p> <p><strong>UPDATE</strong></p> <p>I was back on my PC in two days and here's what I found on the Google Analytics page:</p> <p><img src="https://i.stack.imgur.com/Gb9lJ.png" alt="enter image description here"></p> <p>Problem solved...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload