Hi all, I've been searching for hours for an answer to this. I can never get help from the google forums, so thought I'd try here. I wasn't sure whether I should post in pay-per-click or web design, but I figure PPC people have experience with this kind of thing.

I'm trying to get google website optimizer (gwo) cross-domain tracking working with the asynchronous code described here: http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en&answer=151978

My outbound link looks like this:

<a href="http://secure.ultracart.com" onclick="_gaq.push(['_link', 'http://secure.ultracart.com']); return false;">link</a>

But when I click on that outbound link, it doesn't go to the other website. It works if I remove the return false; but that stops the gwo conversion from registering.

I thought it might be a javascript conflict, so I made this simple test file, and it still doesn't work: http://www.smilinggardener.com/files/test.php

Is there someone here familiar with gwo who knows what the problem might be? If you look at the page source of my test.php, I think the code is perfect. Thanks very much for any advice you can give me.

Phil

Hi Phil,

Unfortunately I have absolutely no experience at all with Website Optimizer, so I probably can't be of much help. However, I noticed that http://secure.ultracart.com automatically redirects to https://secure.ultracart.com. I'm wondering if the cross-domain thing doesn't work when switching from the http protocol to https?

Have you tried to see if the link works when only unsecured pages are involved? Just something to rule out.

Have you tried to see if the link works when only unsecured pages are involved? Just something to rule out.

Thanks so much for the idea, but it doesn't seem to matter what I use for a url.

Does all the code work fine when it's all on the same domain?

I didn't notice the Control Script on your test page mentioned in the documentation page you linked to.

Does all the code work fine when it's all on the same domain?

I didn't notice the Control Script on your test page mentioned in the documentation page you linked to.

The control script is there, right at the top. "<script> _udn = "none"; </script>"

Yes, I've never had any problem with scripts when they're on the same domain. The problem is that the "return false" on my link is causing the link to not work. I believe that is what "return false" is designed to do, but I think I read somewhere that the "_gaq.push();" is supposed to counteract it, to allow the link to work.

The control script is what is below the _udn = "none"; line. I'm really not sure though :( I don't know what else to suggest to you, your code does look just like the sample.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.