AddToAny and Google Analytics (1 post)

  1. andreand
    Posted 5 years ago #

    Hi there,

    I installed AddtoAny share button in my blog, and works fine.

    Do you use this button? Do you like it? Do you track it from Google Analytics?

    I can't get tracking the events of AddToAny in GA.

    It seems that the instructions there are different from the instructions in WP, I mean, I copied this code into my index.php:

    <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>

    from WP instructions:

    And someone has just suggested me that I should use this code in order to track this event on GA:

    <a class="a2a_dd" href="http://www.addtoany.com/share_save">
        <img src="http://static.addtoany.com/buttons/share_save_171_16.png" border="0" alt="Share"/>
    <span id="events_demo"></span>
    <script type="text/javascript">
    // A custom "onReady" handler for AddToAny
    function my_addtoany_onready() {
        events_demo.innerHTML = 'AddToAny menu is ready!';
    // A custom "onShare" handler for AddToAny
    function my_addtoany_onshare(data) {
        events_demo.innerHTML = 'Shared &quot;<a href="'
            + data.url
            + '">'
            + data.title
            + '</a>&quot; to '
            + data.service
            + '!';
    // Setup AddToAny "onReady" and "onShare" callback functions
    var a2a_config = {
        tracking_callback: {
            ready: my_addtoany_onready,
            share: my_addtoany_onshare

    Ops! I don't know how to match the special code for WP with this code.

    It's required to track the button ...

    How can help me, please?

    Do you use this button? Do you like it?

Topic Closed

This topic has been closed to new replies.

About this Topic