Jump to content

dynamically include google conversion code


jl5501

Recommended Posts

I have a question that I think belongs here and not the ajax board, even though ajax is involved.

 

I have a client who wants to include google adwords conversion code when signups occur. So, in theory, it could not be simpler - include the google supplied snippet on the thanks page.

 

Not so simple, there is no thanks page as such. The thank you message is returned to the page from an ajax call, and at this point I would want to include the google code snippet.

 

The google code is not a function call, it is simply a set of variable definitions then the include of a google .js file.

 

So the question is, can I set up these variables (simple) and include the google file (???) in the javascript processing that occurs on return from ajax.

 

I have seen some code in the doing createElement() for a script element, but I am not convinced this would achieve the purpose.

 

Any ideas/pointers would be gratefully received.

So the question is, can I set up these variables (simple) and include the google file (???) in the javascript processing that occurs on return from ajax.

 

I doubt it, the code likely executes when the dom is ready, so it won't execute when you simply place it within an already existing dom. Iv'e not seen the code in question though.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.