Google Analytics错误:无法读取属性' onUpdated'未定义的

时间:2014-06-26 13:48:21

标签: javascript google-analytics

我添加了其他已添加Google Analytics脚本的网页,但我不知道此网站发生了什么: http://calendarios2015.net/

使用Google Chrome按F12查看错误: error http://i59.tinypic.com/j8el9z.jpg

我在此文件的底部添加了Google Analytics(分析)脚本:

$(document).ready(function () {

    // Contact Maps
    $("#maps").gmap3({
        map: {
            options: {
                center: [41.60579, -0.93166],
                zoom: 14,
                scrollwheel: false
            }
        },
        marker: {
            latLng: [41.60579, -0.93166],
            options: {
                icon: new google.maps.MarkerImage(
                    "img/pin.png",
                    new google.maps.Size(48, 48, "px", "px")
                )
            }
        }
    });


    //Selection .active item
    $(function () {
        var pgurl = window.location.href.substr(window.location.href
            .lastIndexOf("/") + 1);
        $(".current-page ul li a").each(function () {
            if ($(this).attr("href") == pgurl || $(this).attr("href") == '')
                $(this).parent("li").addClass("active");
        })
    });

    //Read more
    $('.read-more').click(function () {
        var collapse_content_selector = $(this).attr('href');

        var toggle_switch = $(this);
        $(collapse_content_selector).toggle(function () {
            if ($(this).css('display') == 'none') {
                //change the button label to be 'Show'
                toggle_switch.html('Leer más <span class="glyphicon glyphicon-chevron-down"></span>');
            } else {
                //change the button label to be 'Hide'
                toggle_switch.html('Ocultar <span class="glyphicon glyphicon-chevron-up"></span>');
            }
        });
    });

    //Spain Map
    $(function () {
        $('#map').vectorMap({
            map: 'es_mill_en',
            backgroundColor: '#f5f5f5',
            zoomOnScroll: false,
            regionStyle: {
                initial: {
                    fill: '#1AA2BC'
                }
            },
            onRegionClick: function (event, code) {
                //begin
                switch (code) {
                case 'ES-AN':
                    window.location = 'calendario-laboral-2015-andalucia.php';
                    break
                case 'ES-AR':
                    window.location = 'calendario-laboral-2015-aragon.php';
                    break
                case 'ES-AS':
                    window.location = 'calendario-laboral-2015-asturias.php';
                    break
                case 'ES-EX':
                    window.location = 'calendario-laboral-2015-extremadura.php';
                    break
                case 'ES-CM':
                    window.location = 'calendario-laboral-2015-castilla-la-mancha.php';
                    break
                case 'ES-CT':
                    window.location = 'calendario-laboral-2015-cataluna.php';
                    break
                case 'ES-CB':
                    window.location = 'calendario-laboral-2015-cantabria.php';
                    break
                case 'ES-CL':
                    window.location = 'calendario-laboral-2015-castilla-y-leon.php';
                    break
                case 'ES-GA':
                    window.location = 'calendario-laboral-2015-galicia.php';
                    break
                case 'ES-IB':
                    window.location = 'calendario-laboral-2015-islas-baleares.php';
                    break
                case 'ES-MC':
                    window.location = 'calendario-laboral-2015-murcia.php';
                    break
                case 'ES-MD':
                    window.location = 'calendario-laboral-2015-madrid.php';
                    break
                case 'ES-NC':
                    window.location = 'calendario-laboral-2015-navarra.php';
                    break
                case 'ES-RI':
                    window.location = 'calendario-laboral-2015-la-rioja.php';
                    break
                case 'ES-PV':
                    window.location = 'calendario-laboral-2015-pais-vasco.php';
                    break
                case 'ES-VC':
                    window.location = 'calendario-laboral-2015-valencia.php';
                    break
                default:
                window.location = 'calendario-laboral-2015.php';
                }
                //end
            }
        });
    });

    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-52316871-1', 'auto');
  ga('send', 'pageview'); 
});

0 个答案:

没有答案