Google Analytics setup

trowa
trowa used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lucas BishopMarketing Technologist
Commented:

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.

Author

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.
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

Marketing Technologist
Commented:
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.

Author

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 = )

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial