2014-03-02 79 views
1

我该如何创建一个追踪具有特定标签的已定义页面和所有帖子(wordpress)的目标?例如...我想跟踪页面livespot.pl/gw2/和所有带有“gw2”标签的帖子。我知道如何做到这一点在PHP中,这将检查是否有该标签的帖子或不...但我需要谷歌分析部分的帮助。如何跟踪页面和所有具有特定标签的帖子?

回答

0

像这样使用均匀跟踪。

_gaq.push(['_trackEvent', 'Visit', 'gw2']); 

更多示例参见The Event Tracker Guide。这是完成的JavaScript。

您也可以使用自定义变量,如此处所示Custom Variables

_gaq.push(['_setCustomVar', 
     1,     // This custom var is set to slot #1. Required parameter. 
     'Tag',   // The top-level name for your online content categories. Required parameter. 
     'gw2', // Sets the value of "Section" to "Life & Style" for this particular aricle. Required parameter. 
     3     // Sets the scope to page-level. Optional parameter. 
    ]); 
+0

如何将其添加到网站?只需在我想包含的网页上复制? – Darku

+0

您将需要使用PHP来更改JavaScript发送的标签,然后是。 –

+1

仅用于未来2年的FYI Google正在将其经典分析迁移到Universal Analtyics。 Universal Analytics中的事件跟踪和自定义变量代码与经典代码不同。就像我所说的那样,它现在还不算急,但取决于你如何实现代码,可能值得升级和使用新代码。更多信息:https://developers.google.com/analytics/devguides/collection/upgrade/ – NicoM

相关问题