Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在与drupal联合使用的第三方电子商务网站中识别Google analytics中的流量来源?_Drupal_Google Analytics - Fatal编程技术网

如何在与drupal联合使用的第三方电子商务网站中识别Google analytics中的流量来源?

如何在与drupal联合使用的第三方电子商务网站中识别Google analytics中的流量来源?,drupal,google-analytics,Drupal,Google Analytics,我在Drupal网站上安装了一个Google分析模块。这将跟踪任何有机的流量来源(来自谷歌搜索)。然而,我们正在使用第三方电子商务平台来处理预订信息。这跟踪交易,但不跟踪流量来源-如果原始网站有有机或付费流量来源,第三方网站只认为流量是来自原始网站的转介 这是原始网站callawaygardens.com中的GA代码 var _gaq = _gaq || [];_ gaq.push(["_setAccount", "UA-1162555-1"]);_ gaq.push(["_setDomainN

我在Drupal网站上安装了一个Google分析模块。这将跟踪任何有机的流量来源(来自谷歌搜索)。然而,我们正在使用第三方电子商务平台来处理预订信息。这跟踪交易,但不跟踪流量来源-如果原始网站有有机或付费流量来源,第三方网站只认为流量是来自原始网站的转介

这是原始网站callawaygardens.com中的GA代码

var _gaq = _gaq || [];_
gaq.push(["_setAccount", "UA-1162555-1"]);_
gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_gaq.push(['_setDomainName', 'callawaygardens.com']);
_gaq.push(['_setAllowLinker', true]);
_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);})();
以下是第三方预订网站中的代码: var _gaq=_gaq | |[]; _gaq.push([''设置帐户','UA-1162555-1']); _gaq.push([''u setDomainName','.synxis.com']); _gaq.push([''设置Allowlinker',true]); _gaq.push(['''u trackPageview','Confirmation']); _gaq.push(['''u addTrans', “18174SB007366”,//订单ID-必需 “Callaway Gardens Resort”,//附属机构或商店名称 “119.00”,//总计-必填项 ‘15.47’,//税 '',//运输 ‘纽约’,//城市 'NY',//州或省 “美国”//国家 ]);


由于您没有提到它们,您可能忘记使用_link或_linkByPost函数。仅仅允许GA代码中的链接是不够的,您必须显式地将cookie数据发送到另一个域

文件如下:

更新为添加:

至于Drupal模块,我已经有一段时间没有使用Drupal了,所以我不确定。但是从代码来看,它看起来像是_link方法(与其他域的链接一起工作)被自动附加,而_linkByPost-Data(与表单一起工作)根本没有实现。因此,如果您通过表单将访问者发送到另一个域,这将不起作用


其他想法:也许你的站点和其他域之间存在重定向?在这种情况下,您必须确保重定向不会丢失通过链接器方法添加的数据。

这可以在Drupal中的Google Analytics模块中激活吗?
   // add item might be called for every item in the shopping cart
   // where your ecommerce engine loops through each item in the cart and
   // prints out _addItem for each
  _gaq.push(['_addItem',
    '18174SB007366',                     // order ID - required
    'IMND - BA12',      // SKU/code - required
    'Mountain Creek Inn Double ',                      // product name
    'Best Available Rate',                      // category or variation
    '119.00',                     // unit price - required
    '1'                  // quantity - required
  ]);
  _gaq.push(['_trackTrans']);


  (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);
  })();