开发者

php google analytics question about redirect with 'header'

Hay All.

I'm currently working on a 'checkout' system, the actu开发者_如何学Cal payment and stuff is done by a third party.

When a user checks out using a form it sends all the GET data to some other site, lets call this 'checkout.com'. So the query string is 'checkout.com?var=1&var2=2'.

What i want to do is put a page between my form and this call to checkout.com, i want to be able to log this with google analytics.

Can i use "header("location: checkout.com")"? or will the javascript not get called to log the page?

Do i need to use a HTML redirect? or a javascript redirect? or will the php redriect work properly?

Thanks


Otherwise you could create a Google Analytics event tracking on the link that the user clicks / the form that the user fills out, in order to track the form submit / click.

See http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html


If you are using redirecting the browser, it won't execute the javascript, you'd have to use window.location = 'checkout.com'; and call the google analytics script before the redirect.

I.E.

pageTracker._trackPageview('url of this page');
window.location = 'checkout.com';

checkout this page for more information

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜