| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 814 人关注过本帖
标题:求问这段js代码有什么用的
只看楼主 加入收藏
mqyxgwk81351
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-4-13
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
求问这段js代码有什么用的
(function() {
    var e = window,
    f = "push",
    k = "length",
    l = "prototype",
    q = function(a) {
        if (a.get && a.set) {
            this.clear();
            var d = a.get("buildHitTask");
            a.set("buildHitTask", n(this, d));
            a.set("_rlt", p(this, a.get("_rlt")))
        }
    },
    r = {
        action: "pa",
        promoAction: "promoa",
        id: "ti",
        affiliation: "ta",
        revenue: "tr",
        tax: "tt",
        shipping: "ts",
        coupon: "tcc",
        step: "cos",
        label: "col",
        option: "col",
        options: "col",
        list: "pal",
        listSource: "pls"
    },
    t = {
        id: "id",
        name: "nm",
        brand: "br",
        category: "ca",
        variant: "va",
        position: "ps",
        price: "pr",
        quantity: "qt",
        coupon: "cc",
        "dimension(\\d+)": "cd",
        "metric(\\d+)": "cm"
    },
    u = {
        id: "id",
        name: "nm",
        creative: "cr",
        position: "ps"
    },
    v = function(a, d) {
        this.name = a;
        this.source = d;
        this.e = []
    },
    w = "detail checkout checkout_option click add remove purchase refund".split(" ");
    q[l].clear = function() {
        this.b = void 0;
        this.f = [];
        this.a = [];
        this.g = [];
        this.d = void 0
    };
    q[l].h = function(a, d) {
        var b = d || {};
        "promo_click" == a ? b.promoAction = "click": b.action = a;
        this.b = x(b)
    };
    q[l].j = function(a) { (a = x(a)) && this.f[f](a)
    };
    q[l].i = function(a) {
        var d = x(a);
        if (d) {
            var b, c = a.list || "";
            a = a.listSource || "";
            for (var g = 0; g < this.a[k]; g++) if (this.a[g].name == c) {
                b = this.a[g];
                break
            }
            b || (b = new v(c, a), this.a[f](b));
            b.e[f](d)
        }
    };
    q[l].c = function(a) { (a = x(a)) && this.g[f](a)
    };
    var y = function(a, d, b) {
        if ("[object Array]" == Object[l].toString.call(Object(a))) for (var c = 0; c < a[k]; c++) d.call(b, a[c])
    };
    q[l].data = function(a) {
        if (a && a.ecommerce) {
            a = a.ecommerce;
            a.promoView && y(a.promoView.promotions, this.c, this);
            a.promoClick && (this.h("promo_click", a.promoClick.actionField), y(a.promoClick.promotions, this.c, this));
            for (var d = 0; d < w[k]; d++) {
                var b = a[w[d]];
                if (b) {
                    this.h(w[d], b.actionField);
                    y(b.products, this.j, this);
                    break
                }
            }
            y(a.impressions, this.i, this);
            a.currencyCode && (this.d = a.currencyCode)
        }
    };
    var n = function(a, d) {
        return function(b) {
            var c, g, h;
            a.b && z(r, a.b, b, "&");
            for (c = 0; c < a.f[k]; c++) g = "&pr" + (c + 1),
            z(t, a.f[c], b, g);
            for (c = 0; c < a.a[k]; c++) {
                h = a.a[c];
                g = "&il" + (c + 1);
                h.name && b.set(g + "nm", h.name, !0);
                h.source && b.set(g + "ls", h.source, !0);
                for (var m = 0; m < h.e[k]; m++) z(t, h.e[m], b, g + "pi" + (m + 1))
            }
            for (c = 0; c < a.g[k]; c++) g = "&promo" + (c + 1),
            z(u, a.g[c], b, g);
            a.d && b.set("&cu", a.d, !0);
            a.clear();
            return d(b)
        }
    },
    p = function(a, d) {
        return function(b) {
            var c = a.b && a.b.action;
            if ("purchase" != c && "refund" != c) return d(b)
        }
    },
    x = function(a) {
        var d = 0,
        b = {};
        if (a && "object" == typeof a) for (var c in a) a.hasOwnProperty(c) && (b[c] = a[c], d++);
        return d ? b: void 0
    },
    z = function(a, d, b, c) {
        for (var g in d) if (d.hasOwnProperty(g)) for (var h in a) if (a.hasOwnProperty(h)) {
            var m = g.match("^" + h + "$");
            m && b.set(c + a[h] + m.slice(1).join(""), d[g], !0)
        }
    }; (function() {
        e.gaplugins = e.gaplugins || {};
        e.gaplugins.EC = q;
        q[l].setAction = q[l].h;
        q[l].addProduct = q[l].j;
        q[l].addImpression = q[l].i;
        q[l].addPromo = q[l].c;
        q[l].clear = q[l].clear;
        q[l].data = q[l].data;
        var a = e.GoogleAnalyticsObject || "ga";
        e[a] = e[a] ||
        function() { (e[a].q = e[a].q || [])[f](arguments)
        };
        e[a]("provide", "ec", q)
    })();
})();
搜索更多相关主题的帖子: window revenue function js代码 action 
2015-04-13 16:57
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:10 
运行 看看
2015-04-15 09:23
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:10 
这个程序像是验证数据的,有点像购物中用到的添加、删除、退款等信息的

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2015-04-15 16:56
快速回复:求问这段js代码有什么用的
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019149 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved