我有一個非常特殊的場景,我喜歡在這裏討論。使用GA代碼跟蹤聯盟鏈接
我的系統基於聯盟鏈接共享。
有固定數量的會員共享鏈接(會說,源鏈接)。例如:
http://example.com/affiliate/company1
http://example.com/affiliate/company5
http://example.com/affiliate/company3
http://example.com/affiliate/company2
http://example.com/affiliate/company4
現在,所有這些鏈接重定向到(會說,對象鏈):
http://example.com/page-1.html
源鏈接並不存在於現實中,我必須重寫Apache服務器上的規則重定向任何具有'/ affiliate /'的URL到index.php頁面,我將它們重定向到目標鏈接
我需要使用Google Analytics代碼進行跟蹤,但我無法更改/修改目標鏈接的內容。我怎樣才能實現跟蹤
你是說你不能改變頁面的代碼來包含Google Analytics?或者,你不能改變重定向來添加任意查詢字符串?即,你可以將'/ affiliate/company2'重定向到'page-1.html?affiliate = company2'嗎?如果可以的話,@ josemimg的答案是正確的。 – Yahel