Posts

Showing posts with the label Google Analytics

Javascript: Track Errors with Google Analytics (analytics.js)

      I came across an article by David Walsh and just wanted to expand on the topic. When implementing this feature watch out for the differences between analytics.js and ga.js. The code below is works with analytics.js. Another thing to be aware of is that some errors will be created from Adblocker. I thought of adding the logic but I didn't want to leave it up to chance that I might accidentally ignore some real errors. Instead what you can did is just filter it in Google Analytics and aggregate against with the number hits. (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', 'YOURID', 'aut

Google Analytics for Multiple Environments (Dev/QA/Prod)

Image
    Let's cut to the chase, I was looking for a way to use a single account with a single property  and have multiple views. I thought this was very possible would be easy to manage data that way but I wasn't sure how. After playing around a little with the interface I figured it out. None of the resources directly helped but were really good insight. What I also figured out was that you can use a single line of code to do this, so no need to change the javascript in each environment. This is great because I don't need to alter the javascript snippet to point to the difference environments. Google Analytics Filters     You will need these order to separate the data between different views, use the filter on your views not the property. Under Admin, select your view and then Filters.  For all the filters (Dev,QA, Prod) I did a  Predefined, Included only, traffic to the hostname and that contains.   I've seen in some environments where dev and qa are on a subdoma

Google Authorship with Blogger

Image
    There is no guarantee what will show up in google search for your content but I learned some cool ways  you can influence what appears and I feel not enough people are aware of Google's Authorship feature. This feature allows you to digitally sign off on web content that is yours. That is how I describe it but you can find the actual description in the resource links. Cool Results! The setup for this was really easy and quick, I simply followed the second option for setup and placed the ?rel=author" inside my href that was linked to my Google Plus account. Resources Google Authorship Google Structured Data Testing Tool  - My results! Author information in search results - Webmaster Tools Help

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql