If you have a lot of videos embedded on your website which are not YouTube videos, it will be slightly difficult for you to track the video events using in built options of Google Tag Manager. However, we can use Custom HTML tag with few triggers and variables to achieve the tracking for any kind of HTML 5 video. If your video player uses HTML 5 format, then the below library can be used.
Here, we will be tracking "play", "pause", "complete", "milestones - 25, 50 and 75%" with the library and all of these are tracked as events in Google Analytics. Let us zero in the data we want to see in the reports. I want the event fired from the video to contain the below values
A blog about Digital Analytics, Tag Management Systems, Web Programming, anything and everything about JavaScript
Wednesday, April 15, 2020
Wednesday, April 8, 2020
How to convert CIDR to IP Addresses Range using JavaScript
Many times, when you work on IP Exclusions in Google Analytics, you are required to create IP Addresses range in RegEx format. We have seen how to write a proper RegEx to exclude or include IP Address range in Google Analytics in our previous post. In this post, let us see how to convert a CIDR notation to a range of starting and ending IP addresses using plain JavaScript. CIDR (Classless Inter-Domain Routing, sometimes called supernetting) is an easy way to put a range of IP addresses in a single expression. Unfortunately you cannot enter a CIDR IP in Google Analytics. You have to create a range of starting and ending IP addresses and then come up with a Regular Expression to set them up in the filter. When you have a list of CIDR IPs and it gets frustrating to convert all of them manually going to some website which has a converter and then write the RegEx.
In this post, I have come up with a JavaScript function which you can use quickly to convert a CIDR IP to a starting and ending IP address which you can further use to form a RegEx.
In this post, I have come up with a JavaScript function which you can use quickly to convert a CIDR IP to a starting and ending IP address which you can further use to form a RegEx.
Friday, September 28, 2018
Google Analytics Filters - How to exclude CIDR IP Ranges with Regular Expressions?
In the last post, we have seen how to automatically add a list of rules and channel groups to multiple Google Analytics views. In the current post, let's look at the Filters in Google Analytics and we will take one specific case of excluding all the traffic given an IP Range (CIDR format) using Regular Expressions.
This is pretty straightforward. Filters in Google Analytics provide you the way to include or exclude certain traffic which satisfies a set of predefined rules. Let's say you work for a big organization and all of its workforce access the company's website quite often and do a lot of activity. In this case, your data won't look as cool. Your analytics show a very low bounce rate and high page views which are not really true from a business standpoint. So, what you need to do is exclude this traffic from your organization machines. Another scenario where you want to analyze a specific section of people coming from a city alone. In both the scenarios, what you need to do is to create filters and create standalone views where these filters are applied.
What are Filters?
This is pretty straightforward. Filters in Google Analytics provide you the way to include or exclude certain traffic which satisfies a set of predefined rules. Let's say you work for a big organization and all of its workforce access the company's website quite often and do a lot of activity. In this case, your data won't look as cool. Your analytics show a very low bounce rate and high page views which are not really true from a business standpoint. So, what you need to do is exclude this traffic from your organization machines. Another scenario where you want to analyze a specific section of people coming from a city alone. In both the scenarios, what you need to do is to create filters and create standalone views where these filters are applied.
Subscribe to:
Posts
(
Atom
)