Skip to content

Instantly share code, notes, and snippets.

@googleanalyticsresoneo
Last active October 5, 2015 22:27

Revisions

  1. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    @@ -28,12 +28,13 @@
    <script type="text/javascript">
    // creates the options object for addthis
    var addthis_config = addthis_config || {};
    addthis_config.pubid = 'YOUR PUBID';
    addthis_config.pubid = 'YOUR PUBID'; // AddThis publisher ID, if applicable
    addthis_config.data_ga_tracker = null; // unbind AddThis and GA
    addthis_config.ui_click= true ;

    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one

    addthis_config.data_ga_property = null;
    addthis_config.data_ga_tracker = _gat._getTrackerByName();
    addthis_config.data_ga_social = true;
    // add the rest of Addthis config below
  2. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,13 @@
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <!-- http://support.addthis.com/customer/portal/articles/1293805-using-addthis-asynchronously -->
    <!--
    AddThis integration with Google Analytics Async - (c) 2013 analytics (chez) resoneo (point) com
    https://gist.github.com/googleanalyticsresoneo/2887422
    see http://support.addthis.com/customer/portal/articles/1293805-using-addthis-asynchronously
    -->
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
  3. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -23,10 +23,12 @@
    // creates the options object for addthis
    var addthis_config = addthis_config || {};
    addthis_config.pubid = 'YOUR PUBID';
    addthis_config.data_ga_tracker = null; // unbind AddThis and GA

    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker;

    addthis_config.data_ga_tracker = _gat._getTrackerByName();
    addthis_config.data_ga_social = true;
    // add the rest of Addthis config below

  4. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@
    var adt = document.createElement('script');
    adt.type = 'text/javascript';
    adt.async = true;
    adt.src = 'https://s7.addthis.com/js/300/addthis_widget.js##domready=1';
    adt.src = 'https://s7.addthis.com/js/300/addthis_widget.js#domready=1';
    var adte = document.getElementsByTagName('script')[0];
    adte.parentNode.insertBefore(adt, adte);
    });
  5. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <!-- http://support.addthis.com/customer/portal/articles/1293805-using-addthis-asynchronously -->
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
  6. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-7895389-2']);
    _gaq.push(['_setAccount', 'UA-YYYYYYY-XX']);
    _gaq.push(['_trackPageview']);
    (function () {
    var ga = document.createElement('script');
  7. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,7 @@
    <script type="text/javascript">
    // creates the options object for addthis
    var addthis_config = addthis_config || {};
    addthis_config.pubid = 'YOUR PUBID';
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    var gaPageTracker = _gat._getTrackerByName();
    @@ -32,7 +33,7 @@
    var adt = document.createElement('script');
    adt.type = 'text/javascript';
    adt.async = true;
    adt.src = 'https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6';
    adt.src = 'https://s7.addthis.com/js/300/addthis_widget.js##domready=1';
    var adte = document.getElementsByTagName('script')[0];
    adte.parentNode.insertBefore(adt, adte);
    });
  8. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@
    </head>
    <body>
    <script type="text/javascript">
    // set the options for addthis
    // creates the options object for addthis
    var addthis_config = addthis_config || {};
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    @@ -38,7 +38,7 @@
    });
    </script>
    <!-- AddThis Button BEGIN -->
    <p>Actions on these buttons eventually get tracked to Google Analytics</p>
    <p>Actions on these buttons eventually get tracked to Google Analytics !</p>

    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
  9. googleanalyticsresoneo revised this gist Nov 22, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@
    var adt = document.createElement('script');
    adt.type = 'text/javascript';
    adt.async = true;
    adt.src = 'http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6';
    adt.src = 'https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6';
    var adte = document.getElementsByTagName('script')[0];
    adte.parentNode.insertBefore(adt, adte);
    });
  10. googleanalyticsresoneo revised this gist May 30, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,9 @@
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker;
    addthis_config.data_ga_social = true;
    // add the rest of Addthis config below

    // let's load Addthis' script only once the configuration has been done
    var adt = document.createElement('script');
    adt.type = 'text/javascript';
    adt.async = true;
  11. googleanalyticsresoneo revised this gist May 30, 2013. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,12 @@
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker;
    addthis_config.data_ga_social = true;
    var adt = document.createElement('script');
    adt.type = 'text/javascript';
    adt.async = true;
    adt.src = 'http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6';
    var adte = document.getElementsByTagName('script')[0];
    adte.parentNode.insertBefore(adt, adte);
    });
    </script>
    <!-- AddThis Button BEGIN -->
    @@ -37,7 +43,6 @@
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6"></script>
    <!-- AddThis Button END -->
    </body>
    </html>
  12. googleanalyticsresoneo revised this gist May 30, 2013. 1 changed file with 30 additions and 37 deletions.
    67 changes: 30 additions & 37 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -1,50 +1,43 @@
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
    _gaq.push(['_trackPageview']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-7895389-2']);
    _gaq.push(['_trackPageview']);
    (function () {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
    })();
    </script>
    </head>
    <body>
    <!-- AddThis Button BEGIN -->
    <p>Only actions on this button get tracked to Google Analytics</p>
    <p>Tracks only the opening of the third party service, not effective sharing with loopback, completion</p>
    <a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-xxxxxxxxx"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
    <script type="text/javascript">
    // set the options for addthis
    var addthis_config = addthis_config || {};
    _gaq.push(function () {
    // set the options for addthis
    var addthis_config = addthis_config || {};
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker ;
    addthis_config.data_ga_social = true;
    });
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker;
    addthis_config.data_ga_social = true;
    });
    </script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxx"></script>
    <!-- AddThis Button END -->

    <!-- AddThis Button BEGIN -->
    <p>Actions on these buttons DON'T get tracked to Google Analytics</p>
    <p>Actions on these buttons eventually get tracked to Google Analytics</p>

    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxx"></script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fd1eeba189637b6"></script>
    <!-- AddThis Button END -->


    </body>
    </html>
  13. googleanalyticsresoneo revised this gist Jun 8, 2012. 1 changed file with 31 additions and 7 deletions.
    38 changes: 31 additions & 7 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,11 @@
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXX-X']);
    _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
    _gaq.push(['_trackPageview']);

    (function() {
    @@ -10,17 +14,37 @@
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    </head>
    <body>
    <!-- AddThis Button BEGIN -->
    <p>Only actions on this button get tracked to Google Analytics</p>
    <p>Tracks only the opening of the third party service, not effective sharing with loopback, completion</p>
    <a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pubid=ra-xxxxxxxxx"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
    <script type="text/javascript">
    // set the options for addthis
    var addthis_config = addthis_config || {};
    addthis_config.data_track_clickback = true; // or your own options
    addthis_config.data_ga_tracker = null; // unbind AddThis and GA
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    var addthis_config = addthis_config || {};
    addthis_config.data_ga_tracker = _gat._getTrackerByName();
    var gaPageTracker = _gat._getTrackerByName();
    addthis_config.data_ga_tracker = gaPageTracker ;
    addthis_config.data_ga_social = true;
    });
    </script>
    <!-- where you insert the button , put your pusblisher ID-->
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=XXXXXXXXXXXXXXX"></script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxx"></script>
    <!-- AddThis Button END -->

    <!-- AddThis Button BEGIN -->
    <p>Actions on these buttons DON'T get tracked to Google Analytics</p>
    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxx"></script>
    <!-- AddThis Button END -->


    </body>
    </html>
  14. googleanalyticsresoneo revised this gist Jun 8, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@
    addthis_config.data_ga_tracker = null; // unbind AddThis and GA
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    var addthis_config = addthis_config || {};
    addthis_config.data_ga_tracker = _gat._getTrackerByName();
    addthis_config.data_ga_social = true;
    });
  15. googleanalyticsresoneo created this gist Jun 7, 2012.
    25 changes: 25 additions & 0 deletions ga-addthis.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <script type="text/javascript">
    // standard GA async code
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXX-X']);
    _gaq.push(['_trackPageview']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>
    <script type="text/javascript">
    // set the options for addthis
    var addthis_config = addthis_config || {};
    addthis_config.data_track_clickback = true; // or your own options
    addthis_config.data_ga_tracker = null; // unbind AddThis and GA
    _gaq.push(function () {
    // once ga.js is loaded, bind YOUR tracker with addthis, don't let addthis create a new one
    addthis_config.data_ga_tracker = _gat._getTrackerByName();
    addthis_config.data_ga_social = true;
    });
    </script>
    <!-- where you insert the button , put your pusblisher ID-->
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=XXXXXXXXXXXXXXX"></script>