WordPress.org

Ready to get started?Download WordPress

Forums

Google Adwords Conversion Code & Gravity Forms (3 posts)

  1. janedoe10
    Member
    Posted 1 year ago #

    Hi there, I have looked everywhere to find the answer to this so hoping you can help?

    I need to put the google adwords tracking code on the conversion page on my gravity form (plugin).

    So for instance, if someone fills a contact form and a pop up box says 'thanks' - thats where I need to put the code.

    I cant find how to do that and I not skilled enough to mess with the ftp.

    Thanks for your help -in anticipation...

  2. robgundling
    Member
    Posted 1 year ago #

    You might want to take a look at this (using Google Analytics events)

    http://www.gravityhelp.com/forums/topic/onclick-tracking#post-7734

    Add this below to your functions.php file and change the $form['id'] to your form ID #. Obviously, you can change the Event name sent to Google Analytics.

    <?php
    add_action("gform_post_submission", "gf_ga_tracking", 10, 2);
    function gf_ga_tracking($entry, $form) { 
    
        if($form['id'] != 4) return; ?>
    
        <script type="text/javascript">
            jQuery(document).ready(function($) {
                _gaq.push(['_trackEvent', 'Forms', 'Submission', 'GA Testing Form FINAL']);
            });
        </script>
    
        <div class="ga-confirmation">Nice! Your <strong>successful</strong> form submission was recorded by Google Analytics.</div>
    <?php } ?>
  3. janedoe10
    Member
    Posted 9 months ago #

    Thanks for that. Sorry for the slow response. I have been ill.

    The link seems to go to a closed forum.

    Will that code track the conversion (ie. the completed and sent form) or just a visit to the form page.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic