Analytics
3.7K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Not All Links Tracking Correctly

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello everyone! We use Weebly for our website, and I'm noticing that Google Analytics is not really tracking the /uploads information for some reason. For reference, these links can be found at www.benchmarktechnologygroup.com --> Pick any of the products in the navigation, and each product has a viewable PDF people can click and look at. When clicked it's ourdomain.com/uploads. We would like to see which ones are being viewed.

 

It's weird though because it looks like I can view some of the /uploads information in the Acquisition --> Search Console --> Landing Pages. While that's fine that we can view some it, I would prefer to see all the data and not just ones that are a landing page.

 

Can anyone let me know if there is a filter or anything I need to set to be able to view the /uploads information in my Behavior --> Content reports? Thanks!

Not All Links Tracking Correctly

[ Edited ]
Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

Hi @BenchmarkTechGroup,

You can use event tracking or virtual pageviews to track PDF link clicks, you can check for more here: https://support.google.com/analytics/answer/1012044?hl=en


I guess the same query was asked around november :

https://www.en.advertisercommunity.com/t5/Google-Analytics-Code/How-to-Add-Event-Tracking-to-Weebly-...

Some changes I made to the code which you had done to track '#'.(check above link). You can check and use this to track pdfs (in content reports) as:

( /check-scanners.html/uploads/8/5/2/0/85208914/arca_ls100_check_scanner.pdf) 

 

<script type="text/javascript">

jQuery(document).ready(function () {
jQuery('a[href*=".pdf"]').click(function(){
var match = jQuery(this).attr('href').match(/\.pdf/);
ga('send', 'pageview', location.pathname + match['input']);
});
});
</script>

Hope this helps
Thanks,
Ritwik

Not All Links Tracking Correctly

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hey Ritwik - I added your bit of code last week, and I am thinking it is not working because we haven't gotten any hits to the different pdfs. I added it to the header just like the # one, but I am not seeing the same results. Is there anything else I might have done wrong when adding it to my site? Thanks for your help! Haylee

Not All Links Tracking Correctly

[ Edited ]
Explorer ✭ ✭ ☆
# 4
Explorer ✭ ✭ ☆

Hi @BenchmarkTechGroup,

Actually the Jquery code should fire after its library is loaded. You can do 2 things:

Just replace this code

<script type="text/javascript">
window.addEventListener('load',function () {
jQuery('a[href*=".pdf"]').click(function(){
var match = jQuery(this).attr('href').match(/\.pdf/);
ga('send', 'pageview', location.pathname + match['input']);
});
});
</script>

 

OR

 

place the previous code after the jquery is fetched.
i.e after <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>

 

Kindly check and let me know.

Thanks,
Ritwik

Not All Links Tracking Correctly

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Ok I believe it is working now. I just tested it in real time on my phone (which wouldn't be filtered out), and it was showing real time views of the PDFs. Thank you so much!