AnsweredAssumed Answered

Form fill to page with Google Analytics code without a redirect

Question asked by Robb Barrett Expert on Dec 5, 2016
Latest reply on Dec 5, 2016 by Robb Barrett

Hi all -


I have a vendor that is requesting we have all of our Contact Us links lead to a distinct Thank You page so that we can have conversion tracking. HOWEVER, my goal is to stop directing to a new page so that we don't lose the view of the asset. For example, if you're watching a video and click "Contact Us" we don't want you to navigate away from the video.


To accomplish this I'm trying something out but I want to get some field thoughts on this to make sure I'm doing my due diligence.


How it works: On the page, the form is in a hidden DIV.  When you click the Contact Us button it displays the DIV, which contains the standard Forms code.




form.onSuccess(function() { document.getElementById('contactUsPopUp').innerHTML = ''; setTimeout(function() {document.getElementById('contactUsPopUp').style.display='none';}, 5000); return false; });



(in case HTML isn't showing up:


form.onSuccess(function() {

document.getElementById('contactUsPopUp').innerHTML = '<object type="text/html" data="" ></object>';

setTimeout(function() {document.getElementById('contactUsPopUp').style.display='none';}, 5000);

return false;



My thought is that this pulls the Thank You page into the div, which should pull the GA code as if the person had actually visited that page (looking for confirmation on this). The DIV then auto-closes.  Will Google Analytics still track this as a conversion?


My vendor isn't available yet to test so prior to putting them through testing is there anything I should be thinking about?