3

I'd like to track the number of times a node shows up in search results, the number of times it's clicked on in a search result, and the number of times it is displayed. I'd like all of this information to be readily available - perhaps stored in the content type? I could use some help determining the best practice here.

Alternatively. Could I use google analytics to track all of this somehow such that I could access the results from a custom designed module (which, can anyone point me in a direction on?)

Ultimately I want uses to look at a node and be able to see how much traffic came from in-site linking, off-site linking, and how many times users followed a link from the node to an external website.

Can I export google analytic data for each node somehow to drupal?

0

2 Answers 2

1

The google_analytics_reports module is a starting point for you to look at. I don't think it will cover all your requirements.

2
0

you can do all this by:

  1. using google analytics module (it covers basic tracking, tracking clicks in external links, file downloads, you can also use it to pass tokens into custom variables)
  2. you should add javascript to your node type of choice to add events when clicking in internal links

actually, at the moment, best approach would be to go with Google Tag Manager, where you can enable click tracking in all elements and pick in GTM, which one should be tracked.

take a look at following modules:

https://www.drupal.org/project/google_tag

https://www.drupal.org/project/datalayer

First one installs GTM on your page, second one enables passing many variables and taxonomies to be passed to dataLayer. It also has an alter function, if you'd like to add some extra data (since the module is written in a general way and i.e. extracting taxonomies from json arrays on the GTM side can be complicated).

WARNING! keep in mind, that GA has a limit of events sent during one session, and for one user per day. First one is 500, second one AFAIK is around 200k. It might look that it's more than enough, but if you plan to track no of displays for many elements, you'd use up all your "event credits" right a way - another caveat is, that after the page load, you have a credit of 10-12 events, and each second it adds 2 tokens - it's an DDoS mechanism implemented on server side in GA.

So... what you're describing is more of a adserver mechanism where you want to measure click through rate (CTR) of your "promotional banners" - even if it's a node teaser, if you want to measure CTR, you should think about it as a banner.

Another way to measure it (clicks only) is to add a suffix to node link, which would later on allow on identifying where click came from, but you can also do this with standard reports on a page level, where you can check navigation summary for each page - it won't be as precise to tell you that specific teaser was clicked, but you'll know previous page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.