Google Analytics setup

I need some guidance on these issues.

How can Google Analytics tracks download count?

Will it be automatically tracked or do I need to use some tag manager to do that?

What if the download was done via Javascript? Can it still be tracked? If yes how can we do that?

Thank you.
trowaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lucas BishopMarketing TechnologistCommented:

How can Google Analytics tracks download count?
If there is a "thank you" page, where visitors go after downloading the product, you could count unique pageviews of that page as a download.

Will it be automatically tracked or do I need to use some tag manager to do that?
If the basic GA code is included on the thank you page, yes the pageviews will be tracked automatically.


What if the download was done via Javascript? Can it still be tracked? If yes how can we do that?
You'd either need to configure a custom event in GA that fires each time the javascript is triggered, or setup the javascript to redirect to a "thank you" page (with GA tracking on it) after the download is requested.
trowaAuthor Commented:
You'd either need to configure a custom event in GA that fires each time the javascript is triggered, or setup the javascript to redirect to a "thank you" page (with GA tracking on it) after the download is requested.

Hi there, I'm interested for the first part of your statement.

>>You'd either need to configure a custom event in GA that fires each time the javascript is triggered

Can you give me an example or point me to an online resources for this? Thank you.
lenamtlCommented:
You will found all information on their website
https://developers.google.com/analytics/devguides/collection/analyticsjs/events
https://developers.google.com/analytics/devguides/collection/analyticsjs/pages

Here the code I use sometime ago

function trackDownload(link) {
    _gaq.push(['_trackEvent', 'Downloads', 'Click', 'Setup executable']);
    _gaq.push(function() { document.location = link.href });
    return false;
}
<a href="files/myfile.pdf" onclick="return trackDownload(this);">Download</a>

Open in new window

Lucas BishopMarketing TechnologistCommented:
Can you give me an example or point me to an online resources for this? Thank you.

Sure trowa. Here is Google's starting point for setting up event tracking along with their technical documentation.

Depending on how many different types of events you're planning on setting up, it may be a good idea to look into integrating your events through Google Tag Manager. Personally it's a bit easier for me to manage events through GTM because it provides a more visual representation of everything I'm doing on any given page.

Here is a basic tutorial on setting up GTM to track download link clicks as events.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trowaAuthor Commented:
Hi Lucas,

Google Tag Manager is relatively new to me, I would need to study on it.

But wow! You guys provided me useful information for me to proceed = )
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Google

From novice to tech pro — start learning today.