我在wordpress中使用永久鏈接結構,如www.domain.com/sample-post/
,但它自然阻止它不知道的所有參數。如何在Wordpress中添加Googles utm_source變量?
我其實只是想將一些鏈接追加一些來源的谷歌?utm_source=
變量,但WordPress的阻止他們,我得到一個404錯誤與/none
輸出在我的日誌。
你知道如何解決這個問題嗎?
我在wordpress中使用永久鏈接結構,如www.domain.com/sample-post/
,但它自然阻止它不知道的所有參數。如何在Wordpress中添加Googles utm_source變量?
我其實只是想將一些鏈接追加一些來源的谷歌?utm_source=
變量,但WordPress的阻止他們,我得到一個404錯誤與/none
輸出在我的日誌。
你知道如何解決這個問題嗎?
# Block the include-only files.
RewriteEngine On
RewriteBase/
# RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
# Preventing Directory Listing, Leads to Block and 403 and 401
Options -Indexes
# BEGIN WordPress
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
喜,
我使用domain.com/sample-post/作爲固定鏈接結構
,而不是使用?您可以選擇使用#來傳遞utm_source值。
要做到這一點,只需將此行添加到上面的分析跟蹤代碼_trackPageview _gaq.push(['_ setAllowAnchor',true]);
現在你可以跟蹤代碼utm_source參數,這樣 http://mysite.net/index.html#utm_source=Source&utm_medium=email&utm_campaign=Name
傳遞給服務器WP#心不是之後的數據會繼續看到相同的URL
aweeeeesome!非常感謝! – Boxhorn
如何您已經於可溼性粉劑管理員定義您的永久鏈接結構?你可以發佈你的'.htaccess'重寫嗎? – doublesharp