- Posts: 404
COMMUNITY FORUM
Track Media / Google Analytics
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
9 years 2 weeks ago #153218
by Odin Mayland
Track Media / Google Analytics was created by Odin Mayland
Is there a way to track the plays and downloads of the Media files?
Page of mp3 files:
www.empirearbitration.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=73&Itemid=455
We will have google Analytics setup, so if someone knows how to get stats on a K2 item media file, please help.
Page of mp3 files:
www.empirearbitration.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=73&Itemid=455
We will have google Analytics setup, so if someone knows how to get stats on a K2 item media file, please help.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 weeks ago #153220
by Krikor Boghossian
Replied by Krikor Boghossian on topic Track Media / Google Analytics
Hello Jeff,
It can be done with these two functions.
developers.google.com/analytics/devguides/collection/analyticsjs/events#examples
api.jquery.com/click/
It can be done with these two functions.
developers.google.com/analytics/devguides/collection/analyticsjs/events#examples
api.jquery.com/click/
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
9 years 2 weeks ago #153223
by Odin Mayland
Replied by Odin Mayland on topic Track Media / Google Analytics
can that event tracking code be put in an override?
Please Log in or Create an account to join the conversation.
- JoomlaWorks Support Team
-
- Offline
- Elite Member
Less
More
- Posts: 169
9 years 2 weeks ago #153227
by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic Track Media / Google Analytics
Hello Jeff,
You must place the tracking code to the template that displays the download section and specifically at the download link.
You must place the tracking code to the template that displays the download section and specifically at the download link.
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
9 years 2 weeks ago - 9 years 2 weeks ago #153251
by Odin Mayland
1. Does "specifically at the download link" mean in the k2 item? If so then does that mean I have to use item/media/embed ?
2. Can you paste in the code snippets to this forum so I can learn from your example?
Replied by Odin Mayland on topic Track Media / Google Analytics
Teo wrote: Hello Jeff,
You must place the tracking code to the template that displays the download section and specifically at the download link.
1. Does "specifically at the download link" mean in the k2 item? If so then does that mean I have to use item/media/embed ?
2. Can you paste in the code snippets to this forum so I can learn from your example?
Last edit: 9 years 2 weeks ago by Odin Mayland.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 weeks ago #153263
by Krikor Boghossian
You can use this as an example.
Apart from pageview you can use other events and add labels as well.
You need to consult's the Analytics API for this.
Replied by Krikor Boghossian on topic Track Media / Google Analytics
jQuery('.LINK_CLASS').click(function(){
if (typeof(ga) !== 'undefined') {
ga('create', 'UA-XXXXXXXXX', 'auto');
ga('send', {
hitType: 'pageview',
title: <?php echo $this->item->title; ?>,
location: <?php echo $this->item->absoluteURL; ?>,
});
}
}
});
You can use this as an example.
Apart from pageview you can use other events and add labels as well.
You need to consult's the Analytics API for this.
Please Log in or Create an account to join the conversation.