Forum Moderators: DixonJones
Please shed some lights.
Regards,
getxb
www.example.com/ex5/?/test_x.html
That isn't exactly... best practice syntax. a "?" in a URL indicates that a parameter is about to follow, so I would expect a sytax like:
www.example.com/ex5?source=test_x.html not /?/ <<< That's just bad code!
Anyway - a faitly sure way to fix that woudl be to eliminate the? altogether so that the uri looked like:
www.example.com/ex/test_x.html
then Google Analytics wouldn't assume everything after a? is a variable.
Again one more confusion .. say we do make the url look like www.example.com/ex/test_x.html Now if someone clicks on www.example.com/ex/test_x.html from test.html, (as per the present convention of our site) will lead to www.example.com/test_x.html (redirection) and /ex will continue to be disallowed in the robots.txt
In this case will I get to see the click patterns of link www.example.com/ex/test_x.html in the Site Overlay report for page test.html
so everything after the? means that the url is being redirected! I get it now.
For Google analytics code to run, the page needs to load with the URL you want to track. If you redirect, this usually happens before the code loads - so Google analytics won't pick up the redirect.
So you are aiming to be clever and 301 tracking urls. That makes sense.
I have no idea how to do that using GA, but here's the what I do on my preferred tracking system... we set the tracking element as a cookie, which CAN be done before the page loads, then deliver the 301, then we pick up the cookie on the redirected page and feed that into our tracking code when the page loads.
Took a bit of cracking though! It eliminates any chance of dupes and results in cleaner URLs for the users. the theory is that it should also help Google out... but I never tested that logic in isolation.