1

我正在更改我的 WordPress 永久链接:

/%category%/%post_id%/

至:

/%postname%/

是否可以让谷歌分析继续收集相应的帖子数据?

4

2 回答 2

1

Unfortunately, there is no way to have GA remap previous page name values to new page name values, so you will not be able to compare historical data to current data within GA. To do that, you will have to do a query on your wordpress data to make your own lookup table, etc..

One thing you can do is have GA continue to populate with the old URL...the _trackPageview call takes an optional argument to specify the page name you want reported. You will have to write some server-side code to expose the old value to GA though. Or maybe it might be exposed in a variable already and you just have to pass it to GA.

Another thing you can do is kind of a hybrid.. let GA start recording the new URL as the page name, but also populate one of GA's custom variables with the old URL. You would have to expose it like above, but then it will tie the two values together within GA. There would still be some manual work to do in GA to do things like compare historical data to new data but it might be easier for you to go this route.

于 2012-05-26T00:58:30.703 回答
0

你不必担心这一点。它将自动处理永久链接更改并照常收集统计信息。

于 2012-05-25T18:48:09.823 回答