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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.