- Posts: 404
COMMUNITY FORUM
Google Tracking Attachment Downloads
- Odin Mayland
- Topic Author
- Offline
- Platinum Member
Less
More
7 years 7 months ago #160299
by Odin Mayland
Google Tracking Attachment Downloads was created by Odin Mayland
This is the old site's Google Analytics tracking code:
This is the new K2 site's download code:
How do I get google's onclick tracking code to work with K2-item attachments?
<a href="http://www.icd10monitor.com/podcasts-ttt/TTT-01-24-17.mp3" target="_blank" onclick="_gaq.push(['_trackEvent', 'Podcast', 'Download', 'TTT January 24, 2017']);">Download</a>
This is the new K2 site's download code:
<a title="TTT-01-24-17.mp3" href="/download/71_946967e656163fe7707ffce2a9ed7057">Download</a>
How do I get google's onclick tracking code to work with K2-item attachments?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 7 months ago #160357
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Google Tracking Attachment Downloads
Here you go,
<a href="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" target="_blank" onclick="_gaq.push(['_trackEvent', 'Podcast', 'Download', ' <?php echo JHTML::_('date', $this->item->created , 'd F Y H:i'); ?>']);"><?php echo $attachment->title; ?></a>
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
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
7 years 7 months ago #160359
by Odin Mayland
Replied by Odin Mayland on topic Google Tracking Attachment Downloads
THANK YOU!!!!!! AWESOME :-)
Now I just need help with allvideos k2-item media tracking: www.joomlaworks.net/forum/allvideos/47361-google-tracking-code
Now I just need help with allvideos k2-item media tracking: www.joomlaworks.net/forum/allvideos/47361-google-tracking-code
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 7 months ago #160376
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Google Tracking Attachment Downloads
Thanks Jeff :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.