Keyword

Track Media / Google Analytics

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
8 years 5 months 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.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 5 months ago #153220 by Krikor Boghossian
Replied by Krikor Boghossian on topic Track Media / Google Analytics

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
8 years 5 months 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
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
8 years 5 months 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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
8 years 5 months ago - 8 years 5 months ago #153251 by Odin Mayland
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: 8 years 5 months ago by Odin Mayland.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 5 months ago #153263 by Krikor Boghossian
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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum