Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:56:28+00:00 2026-06-08T04:56:28+00:00

I have never implemented Google Adwords onto a site, so if I am incorrect

  • 0

I have never implemented Google Adwords onto a site, so if I am incorrect with the ‘lingo’, please feel free to correct me.

I am working on a site that has a landing page for one of their Google AdWord campaigns. On this page there is a form, which when processed, takes you to another page to say ‘Thank you for your request…’. I have removed this and rewritten it in PHP and Javascript to prevent the page from refreshing or redirecting.

The problem I have is that on the ‘thank you’ page, the Google code is slightly different and is executed on the loading of the page. My question is, how can I re-execute the conversion code with different variables without re-loading the page? Is there a Google script for this?

Will removing the script tag, and then placing it again re-execute the script?

This is the code I currently have (before the form submission):

<!-- Google Code for Company Remarketing List Remarketing List -->
<script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 000000;
    var google_conversion_language = "en";
    var google_conversion_format = "3";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "abcdefg";
    var google_conversion_value = 0;
    /* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"></script>
<noscript>
    <div style="display:inline;">
        <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/000000/?label=abcdefg&amp;guid=ON&amp;script=0"/>
    </div>
</noscript>

The things that need to be changed after the form submission are:

var google_conversion_id = 111111;
var google_conversion_label = "gfedcba";
"http://www.googleadservices.com/pagead/conversion/gfedcba/?label=111111&amp;guid=ON&amp;script=0

Changing the variables is easy! The hard part is getting the script to re-execute with the new variables.

Any help much appreciated!

UPDATE

The answer posted here probably solves this question, however, I would like to know how I can submit the other variables with the variables that were mentioned in this answer. They are pretty self explanatory but I cannot be sure they are right!

In addition, does anyone know where on Google I can actually see instructions for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:56:29+00:00Added an answer on June 8, 2026 at 4:56 am

    The reason why you can’t just re-execute the script is—as you may have noticed—is that it uses document.write, which should not be called after the document has already loaded.

    One possible solution is to just fire off the GIF request yourself, as you mentioned. If you really want to re-execute the script, there’s the possibility of redirecting document.write.

    Here’s the general idea of how this could be done—this fragment would be placed somewhere where you reload new content into your page. It assumes that you use jQuery and have already loaded the new page content into $newContent and have marked all script tags that need to be executed on reload with class="ajax-exec". What it does is to execute inline script directly and use jQuery’s $.ajax function with dataType: script. It then waits until all external scripts have executed and appends the redirected output to a hidden div.

    This works for us, but comes without warranty (:

    // Execute js from the new content (e.g. AdWords conversions tags).
    // We redirect document.write to a string buffer as we're already
    // done loading the page at this point.
    var buf = '';
    var writeMethSave = document.write;
    $('div#lazyload-buf').remove();
    var done = {};
    
    document.write = function (string) {
            buf += string;
    };
    
    $newContent.filter('script.ajax-exec').each(function () {
        var url = $(this).attr('src');
        if (url) {
            // External script.
            done[url] = false;
            $.ajax({
                url: url,
                dataType: "script",
                success: function () {
                    done[url] = true;
                }
            });
        } else {
            // Inline script.
            $.globalEval($(this).html());
        }
    });
    
    function checkForDone () {
        for (var url in done) {
            if (!done[url]) {
                setTimeout(checkForDone, 25);
                return;
            }
        }
        // All done, restore method and write output to div
        document.write = writeMethSave;
        var $container = $(document.createElement("div"));
        $container.attr('id', 'lazyload-buf');
        $container.hide();
        $(document.body).append($container);  
        $container.html(buf);
    };
    
    setTimeout(checkForDone, 25);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never programed in bash before. I am reading all the files that
I have never come across this issue but most recently I noticed that a
I have implemented a simple D3.js line chart that can be zoomed and panned.
I have never done much with serialization, but am trying to use Google's gson
i have implemented xml files in my iphone applications but never implemented WSDL web
I have a GWT application that features two frames (com.google.gwt.user.client.ui.Frame). Via Frame.setUrl(...) I can
I'm wondering why I have never seen the following way to implement templates in
I have never saved and retrieved an image to and from the database before.
I have never used Foxpro before. Can you convert the following Foxpro code into
I have never done any Windows coding and I would like to give it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.