Until a while ago, the Google Analytics plug-in function was a little-known feature, and even if you searched for “Google Analytics plug-in,” most of the search results that came up were WordPress plug-ins. Regarding such a plug-in function, Google released a plug-in called Autotrack at the end of February 2016, and some developers have begun to recognize the plug-in function of Google Analytics.
Regarding such a Google Analytics plug-in function, SEM Technology released a plug-in called Power Analytics in August 2015, earlier than Autotrack .
This time, in order to compete with Autotrack, we added functions to Power Analytics and upgraded it.
What is Power Analytics
Power Analytics is a Google Analytics plug-in function that I am developing. By introducing this plugin, we are developing with the aim of enabling even people who are not very familiar with Google Analytics to perform measurements that are slightly more powerful than usual.
In the eight months from the release in August 2015 to the end of March 2016, it was used by about 200 domains, with a total traffic of 10,467,966 requests and a peak number of requests of 28,870 requests per hour (481 requests per minute). ).
My biggest concern with the release of Power Analytics was how to configure the server. I didn’t want to make the server too expensive because I didn’t intend to monetize it. As a result, I chose Google App Engine, but this was the correct answer. Since there is almost no dynamic program part, we can use Python’s Bottle framework to obtain only the IP address and rewrite the IP address of plugin.min.js and distribute it, and even with the current traffic volume, App Engine is free available within range.
Powered up Power Analytics new features
External link click event measurement
Although it is a very simple and commonly used event measurement, I wonder why it was not included until now. Get the click of the link coded in the <a> tag and send the click event if the link destination URL is an external link.
ga('PowerAnalytics:outbound');
It is only available in and the events sent are
item | value |
---|---|
event category | Outbound Link |
event action | Click |
event label | Destination URL of the clicked link |
event value | none |
Interaction settings | non-interaction hit |
It is
Click event measurement of phone number link
This is also an event measurement that is in high demand as well as external links. This also gets the click of the link coded in the <a> tag, and sends the click event if the link destination URL is a phone number link.
ga('PowerAnalytics:tel');
It is only available in and the events sent are
item | value |
---|---|
event category | TEL Link |
event action | Click |
event label | URL (phone number) of the clicked link |
event value | none |
Interaction settings | non-interaction hit |
It is
Youtube operation event measurement
This function is effective when using embedded Youtube on the site. By using this function, you can grasp how many YouTube videos on the site are viewed.
To use
ga('PowerAnalytics:youtube');
After that, you need to change each Youtube embed code in the site as follows (add the enablejsapi=1 parameter to the src attribute of the iframe tag).
// 変更前
<iframe width="420" height="315" src="https://www.youtube.com/embed/mnvAOaHz1EQ" frameborder="0" allowfullscreen></iframe>
// 変更後
<iframe width="420" height="315" src="https://www.youtube.com/embed/mnvAOaHz1EQ?enablejsapi=1" frameborder="0" allowfullscreen></iframe>
The event sent is
item | value |
---|---|
event category | Youtube Action |
event action | YT.PlayerState.PLAYING, YT.PlayerState.PAUSED, etc. (*) |
event label | Video ID: Video title |
event value | none |
Interaction settings | non-interaction hit |
It is
*・・・YT.PlayerState.PLAYING, YT.PlayerState.PAUSED, YT.PlayerState.BUFFERING, YT.PlayerState.CUED, YT.PlayerState.UNSTARTED, YT.PlayerState.ENDED
How to use Power Analytics
In order to use all the features of Power Analytics together with the original Power Analytics features, the code will be as follows. Please feel free to delete unnecessary code or change settings as appropriate.
For details on the introduction of Power Analytics and the original functions, please refer to the previous article Introduction to the Google Analytics plug-in “Power 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', 'トラッキングIDをここに入れる', 'auto');
ga('require', 'powerup');
ga('powerup:dimensions', {
'clientid': 1,
'sessionid': 2,
'timestamp': 3,
'ipaddress': 4,
'useragent': 5
});
ga('powerup:spamFilter', {
'dimension': { 'index': 6, 'value': 'Referrer Spam Avoidance' }
});
ga('powerup:source');
ga('powerup:medium');
ga('powerup:outbound');
ga('powerup:tel');
ga('powerup:youtube');
ga('send', 'pageview');
</script>
<script type="text/javascript" async src="//power-analytics.appspot.com/plugin.min.js"></script>
Feature comparison between Power Analytics and Autotrack
I wrote it as a function comparison, but both are plug-ins under development, so it seems that the function will change from moment to moment. Here, I would like to compare from the viewpoint of the design concept of each plug-in .
Autotrack
No hosting server is provided, so you will need to place the Autotrack plugin source code on the server that hosts your website. However, since it is provided as open source, it is possible to download the source code from Github and customize it according to your own site before using it.
Also, although flexible settings are possible, it is difficult for non-engineers to master this plugin because it is necessary to add attributes on the HTML DOM and the options when using the plugin are complicated. think. Conversely, if you are an engineer who has a general understanding of Google Analytics, you will find the Autotrack plugin useful.
Power Analytics
By hosting the plugin on Google Apps Engine, you don’t need to put any additional JavaScript code on your website. However, since the source code cannot be freely modified, developers themselves cannot incorporate functions that Power Analytics does not provide.
Since it is designed to minimize customizability and option settings, even non-engineers who lack flexibility can introduce it with some knowledge of Google Analytics.
summary
I’ve also heard rumors that most sites that have Google Analytics use the default tracking code without any changes. I think that there are many people who are busy with site/content creation and do not even bother with tracking codes. However, it is clear that we will shift to digital marketing in the future, so we will first introduce tools that can extend the Google Analytics measurement code, such as Power Analytics and Autotrack, so that we can easily use Google Analytics. I think it’s a good idea to prepare the measurement environment.