Lead Gen & CRM
How can we help you?
Search our help articles, video tutorials, and quickstart guides

You've got this. You've got us. Search our Knowledge Base to quickly find answers to your questions.

Gravity Forms Integration Tool

Article: 000050425
Updated: July 18, 2024

Integrate your Gravity Forms into Lead Gen & CRM by modifying your websites functions.php file

Gravity Forms is a third-party form builder for WordPress websites. These forms can integrate into Lead Gen & CRM. There are two ways to add Gravity Forms to Lead Gen & CRM website. You can use the standard third-party form integration available from the Forms tab in Lead Gen & CRM, or you can modify your website’s functions.php file.

In this article, you’ll learn how to connect Gravity Forms to your Lead Gen & CRM instance by modifying your website’s functions.php file.


Article Contents

 
 
Users:
Administrators 
Company Managers  
Marketing Managers  
Sales Managers  
Salespersons  
Jr. Salespersons  


Important Information Regarding Connection

If you have not yet connected Gravity Forms using this method, refer instead to Connecting Gravity Forms. Continue reading this article only if you have previously connected Gravity Forms using this method.
 



Regarding Integrated Code

Note: Constant Contact offers Professional Services to assist with custom coding.

Running the following generated code or your entire functions.php file through a .PHP validator will decrease the risk of a crash, but it will not catch everything. For more information on .PHP validation, refer to https://phpcodechecker.com/

This integration tool is provided as-is to assist with the setup of integrating Gravity Forms, but this may run into complications due to the configuration within Gravity Forms. This includes, but is not limited to:

  • A non-standard Gravity Forms configuration
  • Other plugins that interfere
  • Additional parameters outside of Lead Gen & CRM's control

If Lead Gen & CRM form code has already been placed on your webpage, it should be removed. The .PHP code generated in this article replaces its function.

Be aware that this process will ultimately replace the form embed code provided by Lead Gen & CRM. Because of this, Lead Gen & CRM's form code should not be added to the page.

The .PHP code added through this process will cause Gravity Forms to send the data to Lead Gen & CRM instead. If Lead Gen & CRM Form code is present on the page, it will cause conflicts.
 



Generating Form Codes

To integrate Gravity Forms, you will need access to your Lead Gen & CRM account and Wordpress accounts. Also, you must be using Gravity Forms on your site in order for this integration to work. Refer to For Developers: Integrating Gravity Forms for developer instructions.

This article can help you generate the PHP code you'll need, using form code from Lead Gen & CRM.  Do the following: 

  1. Open a new tab in your web browser.
  2. Create or open a Gravity Form in that browser tab.
  3. Obtain the Gravity Form's identification number.
  4. Open another new tab in your web browser.
  5. Log in to Lead Gen & CRM in that browser tab.
  6. Click Forms in the left toolbar.
  7. Create or edit a third-party form.
  8. Copy the embed code that appears.
  9. Note: If you navigate away from the page you can still access this code. Simply, click  12more.png  Actions > Embed Code, next to your form. 
  10. Copy the embed code.
  11. Paste the embed code in the following box:

     

  12. Insert the identification number of your Gravity Form in the following box:

     

  13. Insert the applicable field labels and field identification numbers, and click the applicable checkboxes in the following table:
     

    Note: Field labels should not contain special characters or accented numbers.

    Labels should contain only the following:

       •   Capital letters (A-Z) 
       •   Lowercase letters (a-z)
       •   Numbers (0-9)
       •   Spaces
       •   Dashes
       •   Underscores

    Also, field names here do not need to match the field names within Gravity Forms.
     
    Field
    Label
    Field ID
    Number
    Checkbox Group?
       
       
       
       
       

    Generate Code Add More Fields

     

  14. Click the Generate Code button above.
  15. Copy the code that is generated below:


     
  16. Place the generated code snippet obtained above into the functions.php file within your WordPress theme editor.
Important: Some themes may hide access to the functions.php file. It can also be accessed using FTP. Contact your website administrator if you do not see the functions.php file.

Additionally, FTP access is recommended in case the functions.php file needs to be reverted, as incorrect code here can make the site inaccessible except from FTP.  Pay close attention to the code that you add to functions.php. If you add incorrect code, you may be locked out of your Wordpress account.

Create a backup of your current functions.php before making these changes and be prepared to replace it via FTP if needed.


Adding Gravity Forms to Wordpress

Once you have generated a Gravity Form code, you can add the form to Wordpress.

To add a Gravity Form to Wordpress, do the following:

  1. Open another tab in your web browser.
  2. Log in to Wordpress in that browser tab.
  3. Click Editor, located under Appearance in the left menu.
  4. Click the functions.php file in the right menu.
  5. Copy the above generated code snippet.
  6. Paste the copied code snippet at the bottom of your functions.php file.
  7. Click Save.
Wordpress Editor Theme Functions
 
Important: Changes to the functions.php file in Wordpress can result in your site crashing. Be sure you have FTP access in order to backup and revert to your old functions.php file if needed.
 


Did this article answer your question?


Constant Contact Logo

Copyright © 2025 · All Rights Reserved · Constant Contact · Privacy Center