Need help setting up Google offline conversion tracking with Jotforms

  • booker12
    Asked on June 10, 2016 at 12:56 PM

    Hi,

    I am going through the process of setting up "Google offline conversion tracking" and I need help with the following issues:

    (The Google support article for setting up "Google offline conversion tracking" is https://support.google.com/adwords/answer/7012522)

     

    -Issue#1:

    Step 2.2 in the article needs me to add the following line of code to the jotform, 

    The purpose is to pass the captured GCLID to the jotform so it can be sent to our email address when user submits the completed jotform.

    Currently, we are using the javascript code to embed jotforms on our web pages (example: http://www.curtain-and-divider.com/industrial-curtain-quote-form/) and I am not sure how to pass the captured GCLID to the jotform when using the javascript embedding. I don't want to embed the jotform using the "jotform source code" or even the iframe for that matter.

    If you are wondering how I am capturing the GCLID, I have placed the codes provided in the Google support article to the footer area of my site that captures the GCLID, and will pass the GCLID to the jotform if I am able to add the above highlighted code to the jotforms.

     

    -Issue#2:

    Following is the last part of setting up Google offline conversion tracking, can anyone tell me what does it actually mean? We get emails when jotform is submitted and we copy the jotform data into excel sheets manually. So I guess we don't have to do anything for the following step, but I maybe wrong:

    "Modify your backend customer data management system so it can store the GCLID along with the prospect's information. For example, if you're using a lead management system, add a custom field to your lead object so this ID can be stored and retrieved easily and reliably. Check the help center of the system you use for specific integration guides."

     

    I thank everyone in advance who might help me resolve the above issues. 

  • Charlie
    Replied on June 10, 2016 at 1:56 PM

    I'm sorry, my knowledge with Offline Conversion tracking is limited so my answer might not satisfy your needs.

    Now if you are looking for the conversion rates of your forms, you can add the Google Analytics widget. I am not sure that widget will help or if that's what you need.

    Please do keep in mind that even though the form is embedded as a <script>, I see that it is still loaded as an iframe in the page source. 

     

    Now as stated in the article, this HTML line "<input type="hidden" id="gclid_field" name="gclid_field" value=""> " should be added inside the <form> tag, unfortunately, as you already know, you cannot do this unless you use the form's full source code.

    However, I was thinking if you could add this inside the "Thank You" page source code? I believe the thank you page of the form is still technically the submission page where the prospect should be added?

     

    With regards to issue #2, I believe it means you'll saved the GCLID in your database. In the article, the <input> tag is part of the <form> element which means it is part of the POST data being submitted. In your case, it is not possible because the <input> tag that we added is not really part of the actual submission, unless of course you create a text box like that or if you added it manually in the full source code. 

    I hope that somehow this helps.

  • booker12
    Replied on June 10, 2016 at 6:38 PM

    Thank you Charlie, 

    You might want to discuss the following with someone who knows their way around coding. Please remember that my website is WordPress based. 

    I need the GCLID to be sent with the submitted form to our email address so we can relate jotform submissions to the proper GCLID. So, I can't add the <input> field to the "Thank You/Confirmation" page because this will mean the GCLID doesn't get sent in the form submission email.

    I am thinking about two resolutions so please help me decide which one is correct

     

    Resolution #1: I added a hidden field to the jotform through the "Hidden Box" widget. When I checked the jotform source code, the relevant line of code was:

    <input type="hidden" class="form-hidden" value="" id="input_6" name="q6_gclid_field" />

    I took the ID (input_6) and put it in the code Google gave me because Google says (please refer to https://support.google.com/adwords/answer/7012522):

    Need help setting up Google offline conversion tracking with Jotforms Image 1 Screenshot 30

    So I changed this (code to retrieve GCLID from cookie and store as value of the hidden jotform field):

    window.onload = function() { document.getElementById('gclid_field').value = readCookie('gclid'); }

    to this: window.onload = function() { document.getElementById('input_6').value = readCookie('gclid'); }
    In this case, will it work? Will the GCLID get sent in the email as a value of the hidden jotform field?

    Resolution #2: In case the above isn't possible, I saw something in the link https://www.jotform.com/answers/75046-Append-Referring-URL-to-form-results where Liyam from Jotform was able to present something interesting (see the screen capture below). He passed a variable (referrerDataField) with the jotform source URL, can I do the same thing with a GCLID? If I have the GCLID saved in a cookie, can I append the GCLID with the jotform source URL? If yes, can the jotform source URL (appended with the GCLID) be sent through email with the form submission. 
    Need help setting up Google offline conversion tracking with Jotforms Image 2 Screenshot 41
    I hope someone from Jotform will be able to help in detail with this.
  • Mike
    Replied on June 10, 2016 at 9:02 PM

    Please try with the next code.

    http://pastebin.com/raw/LaKNAWuk

    It seems to be working right on my test form. The hidden field value should be populated from the cookie and submitted with form.

    Need help setting up Google offline conversion tracking with Jotforms Image 1 Screenshot 20

    If you need any further assistance on this, please let us know.

  • booker12
    Replied on June 11, 2016 at 1:19 PM

    Hi Mike,

    Thanks, can you somehow share with me your test form and the codes to setup and read cookie you added on your test website? I just want to make sure I am setting up everything properly. Right now, when I submit the form, I don't even see the hidden field in the submission. 

  • KadeJM
    Replied on June 11, 2016 at 3:07 PM

    Looking at his provided screenshot it appears that he just made a very simple html page with the script embedded in the body of the test page though I cannot say for sure without checking it closer to be more accurate.

    So for that reason please also allow me to check in with my colleague about this further just in case so that we may pass along more about his example to allow you to take a closer look at it.

  • booker12
    Replied on June 11, 2016 at 3:17 PM

    Thank you so much everyone for helping me. It seems I have fixed the issue. 

     

    I will post what I did to get it working very soon so someone else having the same issue might be able to get things going.

     

    One last thing, I think Mike would be able to help in this because he suggested it:

    In the piece of code below, I am using the form ID "51154360685960" and field ID "input_6" which is good for one form, what I should be doing if I want this thing setup on multiple forms that will have their own unique form IDs and field IDs? Can I use some sort of variable in here? Keep in mind, I have put this code in footer.php of my WordPress theme

    window.frames['51154360685960'].document.getElementById('input_6').value = readCookie('gclid');
  • KadeJM
    Replied on June 11, 2016 at 4:29 PM

    If they are on separate pages depending on where you put mike's script you could just have one for each page.

    However, if you are having that script run from main page as a centralized hub then it'd probably be better to combine it all into one script and just change add in additional lines for the window load for your cookies.

    So for instance I would leave this as it is in yellow and append additional forms and field id's onto it in green but just be sure to change out the form id and field id: 

    <script>

    function readCookie(name) {

    var n = name + "=";

    var cookie = document.cookie.split (';');

    for (var i=0;i < cookie.length;i++) {

    var c = cookie[i];

    while (c.charAt(0)==' ') {c= c.substring(1,c.length);}

    if (c.indexOf(n) == 0) {return c.substring(n.length,c.length);}

    }

    return null;

    }

    window.onload = function () {

    window.frames['xxxxxxxxxxx'].document.getElementById('input_x').value = 

    readCookie('gclid')

    }

    window.onload = function () {

    window.frames['xxxxxxxxxxx'].document.getElementById('input_x').value = 

    readCookie('gclid')

    }

     

    </script>

  • kelliemorgan
    Replied on September 13, 2016 at 5:15 PM

    We're trying to get keyword data from our Adwords campaigns when a user fills out a form on our web page. The keyword that is used to trigger an ad should be passed in a hidden field on the Jotform so it will appear in the data when those completed forms are emailed back to us. I'm assuming that this method will work for that...

    I have a few questions on what's been said so far:

    1) In the last response by KadeJM, does that bit of code replace the embedded Jotform code that one would usually use on a web page?

    2) Can you please explain in detail what he means by "append additional forms and field id's onto it in green but just be sure to change out the form id and field id".

    3) Does every use of this form on a different web page need its own unique form ID?

     

    4) What is the field ID and what is it used for?

     

    Thanks.

  • Mike
    Replied on September 13, 2016 at 7:22 PM

    1) In the last response by KadeJM, does that bit of code replace the embedded Jotform code that one would usually use on a web page?

    No, that was an additional code used to populate a form field with a GCLID value.

    2) Can you please explain in detail what he means by "append additional forms and field id's onto it in green but just be sure to change out the form id and field id".

    Kade provided a code example for a case where you embed multiple forms. If you do not need to populate the GCLID value on the second embedded form, you do not need the code highlighted in green.

    3) Does every use of this form on a different web page need its own unique form ID?

    No, the form ID is always the same. Each form has its unique ID.

    4) What is the field ID and what is it used for?

    The field ID is an internal ID of the corresponding form field. It can be checked via form source code or editor.

    Need help setting up Google offline conversion tracking with Jotforms Image 1 Screenshot 20

    The IDs are usually used to apply custom styling to them and for custom coding.

  • kelliemorgan
    Replied on September 15, 2016 at 7:29 PM

    I'm still a little confused as to what we're supposed to do over here to capture a keyword bidded on that resulted in an ad from Google getting clicked, and have the user fill out a jotform, and have that info along with the keyword we bidded on, sent to us via email.

    I've already added the hidden field below the Submit button on our form.

    1) From the Jotform side, what code do I need to add to each page (just the code in yellow?)...and do I still use the JS embed piece of code given to us for each form?

    2) If I want to include this piece of code for each of our forms which are on different pages, does anything about the code need to be changed?

    Thanks for your help.

     

     

     

     

  • Charlie
    Replied on September 15, 2016 at 8:59 PM

    @kelliemorgan

    I presume you are not the same person who started this thread post? I  have opened a separate thread for your concern, please refer to this link instead: https://www.jotform.com/answers/933783 

    We will address it accordingly. 

    Thank you.