I am new to Drupal. I have added AddtoAny module for one of my tasks and it is working perfect. Thanks to Developer.

I want to track the links given in the module like Facebook, Gmail, Twitter etc. How do I do that? I have researched and came to know that it is already implemented in the code and has been given in the AddtoAny API. As I am new to Drupal, so I don't know how and where do I make changes?

Could anyone help me regarding this in steps?

Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Yet Another User’s picture

Where (Which file and section) can I include code given in these links?

http://www.addtoany.com/buttons/customize/events

http://www.addtoany.com/buttons/customize/link_tracking

Thanks.

micropat’s picture

Category: task » support

If you're using Google Analytics already, tracking clicks (shares) is completely automatic. Here is how to access sharing stats within Google Analytics:
http://www.addtoany.com/ext/google_analytics/

If you'd like to enable "click-back" tracking (which tracks each visit to your site from a shared link) for certain social networks, go to your AddToAny settings in Drupal admin, then add one of the following blocks of code into the Additional Options box:

Adds Google Analytics parameters to shared links, for "click-back" tracking:
a2a_config.track_links = 'ga';

Uses a bit.ly short URL for shared links, for "click-back" tracking:

a2a_config.track_links = 'bitly';
a2a_config.track_links_key = 'addtoany|R_4ed7bcc558a86d04901bfae7c3a20bb5'; // username|API key delimited by |

For bit.ly, replace addtoany|R_4ed7bcc558a86d04901bfae7c3a20bb5 with [your bit.ly username]|[your bit.ly key]

Other click-back tracking options (including custom URLs) are documented here: http://www.addtoany.com/buttons/customize/link_tracking

Yet Another User’s picture

Status: Active » Closed (fixed)
FileSize
76.69 KB

Dear Micropat,

Thanks for your reply. I have closed the issue as it is working and will reopen it if necessary. It is working but still it is showing that Event Tracking is not installed on my machine. Please check the attachment.

Thanks for your time.

micropat’s picture

For this to work, it is a prerequisite that you already have Google Analytics installed on your site. Perhaps install the Google Analytics module?

After you have Google Analytics installed, AddToAny sharing stats will be automatically sent to your Google Analytics. Hopefully this clarifies, Mohit. Cheers.