使用Google Analytics跟踪下载(ga.js)

时间:2016-01-29 16:16:56

标签: google-analytics

我无法让我的事件跟踪工作在我们的网站上进行一些下载。这是我在页面上插入的代码。单击链接时代码确实执行,但我没有看到事件显示在实时查看器中。

$(document).ready(function(){
    $("a").click(function(){
        if ($(this).attr('href').match(/\/showdocument\?id\=\d+$/ig)) {
            );
            _gaq.push(['_trackEvent','DocumentManager','click',$(this).attr('href')])
        }
        if ($(this).attr('href').match(/.*\.mankatomn\.gov.*(\.pdf|\.mp3)$/ig)){
            _gaq.push(['_trackEvent','DocumentManager','click',$(this).attr('href')])
        }
     });
});

我在这里遗漏了一些明显的东西?除了将过去给我的代码粘贴到页面上之外,我没有与GA合作过多。

1 个答案:

答案 0 :(得分:0)

来发现问题是我过滤掉了我们的IP地址,因此我没有看到结果。一旦我删除它,它就开始工作了。 : - /

相关问题