You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2018/03/24 19:03:17 UTC

[accumulo-website] branch asf-site updated: Jekyll build from master:ef69051

This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/accumulo-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 9bcf41a  Jekyll build from master:ef69051
9bcf41a is described below

commit 9bcf41a45eab87d649d8a1c6ea5af8af40d63d16
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Sat Mar 24 15:00:17 2018 -0400

    Jekyll build from master:ef69051
    
    Fix Google Analytics (migration to gtag.js)
    
    Fix Google Analytics click event handler for download links, which were
    broken after the migration from analytics.js to gtag.js
    
    This repairs the sending of the click event for downloads to Google
    Analytics.
---
 downloads/index.html | 21 +++++++++++++++------
 feed.xml             |  4 ++--
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/downloads/index.html b/downloads/index.html
index 1ff2dbf..2631b04 100644
--- a/downloads/index.html
+++ b/downloads/index.html
@@ -154,7 +154,7 @@
 * This function takes a valid URL string as an argument, and uses that URL string
 * as the event label.
 */
-var gaCallback = function(event) {
+var gtagCallback = function(event) {
   var hrefUrl = event.target.getAttribute('href')
   if (event.ctrlKey || event.shiftKey || event.metaKey || event.which == 2) {
     var newWin = true;}
@@ -162,18 +162,27 @@ var gaCallback = function(event) {
   // $(this) != this
   var url = window.location.protocol + "//accumulo.apache.org" + $(this).attr("id")
   if (newWin) {
-    ga('send', 'event', 'outbound', 'click', url, {'nonInteraction': 1});
+    gtag('event', 'click', {
+      'event_category': 'outbound',
+      'event_label': url,
+      'transport_type': 'beacon'
+    });
     return true;
   } else {
-    ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
-    function () {window.location.href = hrefUrl;}}, {'nonInteraction': 1});
+    gtag('event', 'click', {
+      'event_category': 'outbound',
+      'event_label': url,
+      'transport_type': 'beacon',
+      'event_callback': function(){ window.location.href = hrefUrl; }
+    });
     return false;
   }
 };
 
 $( document ).ready(function() {
-  if (ga.hasOwnProperty('loaded') && ga.loaded === true) {
-    $('.download_external').click(gaCallback);
+  // check if gtag is loaded
+  if (typeof gtag === 'function') {
+    $('.download_external').click(gtagCallback);
   }
 });
 
diff --git a/feed.xml b/feed.xml
index 60c7660..a1c7bc1 100644
--- a/feed.xml
+++ b/feed.xml
@@ -6,8 +6,8 @@
 </description>
     <link>https://accumulo.apache.org/</link>
     <atom:link href="https://accumulo.apache.org/feed.xml" rel="self" type="application/rss+xml"/>
-    <pubDate>Sat, 24 Mar 2018 14:17:43 -0400</pubDate>
-    <lastBuildDate>Sat, 24 Mar 2018 14:17:43 -0400</lastBuildDate>
+    <pubDate>Sat, 24 Mar 2018 15:01:39 -0400</pubDate>
+    <lastBuildDate>Sat, 24 Mar 2018 15:01:39 -0400</lastBuildDate>
     <generator>Jekyll v3.6.2</generator>
     
     

-- 
To stop receiving notification emails like this one, please contact
ctubbsii@apache.org.