Display page views based on Google Analytics in Jekyll - google-analytics

Is there any way to display page views based on Google Analytics on a Jekyll site? We’ve been using jekyll-ga plugin, but it hasn’t been updated in a very long time. So updating, for example, google-api-client (to use it with the newest version of Ruby) raises a lot of errors.
It would be great to get page views from Google Analytics in real time (and not only at the time of build). But for now we are looking for any solution which can replace jekyll-ga plugin.
I would appreciate any feedback.

Related

Implementing Google Analytics and Google Tag Manager tracking codes on a Wordpress site with Personal plan

I have a Wordpress website and have the Personal plan.
My goal is to implement the tracking code of the Google Tag Manager on each site.
When I am on the Wordpress site in the HTML view, I should be able to paste one tracking code as close to the opening <head> tag as possible on every page of my website but this is not possible.
That´s why I had a talk with somebody from the Wordpress Support team and their answer was the following:
I believe the code for Google Analytics is meant to go in the header of the site. Since WordPress.com is a fully managed environment, we don't have access to the header code.
Instead, we have a built in Google Analytics option available as part of the Business upgrade.
The issue is I don´t want to spend 25$ a month just to have Google Analytics integrated on my website. There must be also a way for somebody like me with a Personal plan to implement the tracking codes.
When I tried to implement them, they were not hidden on the website which should not be the case (because "hidden" is in the code).
Did anybody of you have the same issue like I am facing?
P.S.: There are also Plugins for Google Analytics but with my plan I can´t upload any Plugins. :/
I integrated the code on a text widget. It worked just fine. If you dont give title to the widget, its even completly invisible. so dont spend unecessary money

Can I use ga.js in one page and analytics.js in others and consolidate the results?

I have a website that has a landing page built and hosted on a website development platform (Wix). I have no control over the code, and to use Google Analytics I can only input the Property code and it's automatically implemented. The thing is that they still use ga.js, and the rest of my website, hosted in my own server, uses analytics.js.
I thought about using different properties, but then I wouldn't have the data all in one place.
Is it possible to consolidate the data? If not, what is the best way to deal with it?
Thanks.
==== [EDIT] New info.
Thanks MarkeD and Marcel Dumont. Using ga.js with another property seems to be the way to go, but there's another issue. The landing page in Wix is the www subdomain, and when the user goes to my server it goes to another subdomain, so I'd have to add "pageTracker._setDomainName('mydomain.com');" to the Wix page tracking code, which can't be done.
Any new ideas?
Thanks again.
Afraid that out-of-the-box there is no satisfiable solution for your issue.
You cannot use the old and new method within one profile, and there is no method to consolidate data across two profiles.
Even if you would put in a lot of efforts use the APIs to manually query and consolidate both profile data into your own Database/Dataware house you would still face problems with the inability to add visitor/visit data together.
As workaround, why not run old-style GA next to your Universal Analytics on the rest of the website? not ideal to use old-style, but at least that will give you overall data.
The old ga.js will still send data to a Universal Analytics property, so you could run both into the same account, once it is upgraded to Universal Analytics.
Google reference on upgrading from ga.js and analytics.js
Note that the reference states if you have ga.js and analytics.js on the page, it will double count. (i.e. data is sent with both)
So I would put the same UA code on your Wix as your ga.js main website, and use as normal. The data will be a bit more flaky as the sessions are calculated slightly differently under the two scripts, but when Wix finally upgrades to ga.js that should sort itself out.

Google analytics and slow load

I'm a bit new to this and a total non-techy. Basically the site I work on doesn't currently have much in the way of analytics other than the standard GA reporting and some events as and when reporting has been required by marketing. I come from a background where the site I worked on had a different analytics tool and pretty much every click event or interaction on the site could be reported on. This made it really easy to pull off analytics on any area of the site as and when required in a more proactive way without the need for dev work.
The developers I am working with now are telling me that if we were to put events on the core areas of the site I have asked for (ie core user journeys and key features), it will affect the load times of the pages too much. Could someone advise, 1- is this the case with GA? 2- is there any way around it? 3- is this an issue unique to GA or any analytics tool
This is not an issue with Google Analytics or any web analytics tool. Google code is loaded asynchronously (so it can't block page load) and by the time the events are attached the page is already loaded (else attaching events would hardly be possible).
It might be that your developers are concerned that page performance (not load time, though) suffers when they add a script that has to modify every single DOM element. That argument might have merits (hard to say without knowing your site) but has nothing to do with the analytics tool.

Google Analytics Tracker showing Tracking Not Installed

Using wordpress, I manually inserted the tracking code given to me by Google Analytics just before the tag into my header.php file. Google Analytics is still showing Tracking Not Installed.
here's the source code for my site:
view-source:http://funnykittenmemes.com/
Any ideas?
It looks like the javascript is broken from cutting and pasting.
Easiest thing to do is use a plugin rather then edit theme files. Take a look at http://wordpress.org/plugins/search.php?q=google+analytics for any number of plugins - simple to complex - that will work.
Most you simply enter your Google ID - and sometimes authenticate with your Google account - and the plugin takes it from there.

Track number of impressions of a widget running on a remote website

I have created a widget that is being hosted on a number of websites. I originally implemented the code using only jquery and JSONP to buid the widget. Upon implementing the widget on live webiste though we had the unfortunate experience of that other widgets which were on the site already had really poor javascript in them which killed our widget, so to cut a long story short I have created a second version which works using an IFrame. I have read up on the google analytics site that you can track usage in an IFrame fairly easily, but is there any way that I could track the usage of the original, iframeless version using Google Analytics. I could of course simply have an app on my side which counts the number of time the webservice I'm using to render the widget is called, and count the number of referrals on my site, but this seams like re-inventing the wheel when we already have Google Ananlytics to do this.
I don't think it's reinventing the wheel since Google Analytics is not designed to do this.
The advantage of having an iframe is that the content of the iframe is on your site, and thus under your control. With your plugin on the wild everything you do is shared with the global page namespace and in the same manner the other extension killed yours, your extension could have killed others.
If you implement analytics on your extension you could be impacting the site very heavily if it also uses Google Analytics.
Multiple trackers on a single page is tricky in Analytics. It's possible but not very well supported and not recommended by Google.
The problem happens when you have conflicting Google Analytics settings with the other trackers on the page. Since you're sharing the same cookies both tracker configurations must be compatible.
eg:
If one uses _setAllowHash and the other does not the cookies will be reset for each time a pageview is fired, possibly breaking both implementations pretty badly.
So if you have other means to track your extension go for it. Try to use Google Analytics only on your domain, so you're free to go if you're doing it inside your iframe, otherwise try to avoid it.
If you can update the other extensions that are out there, why not just replace it with the iframe versions of it?

Resources