How to get Gravity Forms and Zoho CRM to play

Update December 2011

This plugin is now available – see http://helpforwp.com/plugins/

Update October 2011!

Since writing this post, I have written a WordPress plugin that does all the heavy lifting to get this to work.

If you use Gravity Forms and Zoho CRM this plugin is for you. It will be released mid November 2011, leave a comment on this post if you would like to be notified when it is available.

–End of update–

This post is going to be pretty specific, but if like me you’ve been looking to get Gravity Forms to send data into Zoho’s CRM tool you’re in the right place.

By themselves these are both great tools that we use all the time. Particularly Gravity Forms, as far as form plugins for WordPress goes, there is no equal.

So here’s the situation.

Zoho CRM has the functionality to create a web to lead form, which is the basic functionality that users generally want to get started. Website visitors can fill in the form and the lead/enquiry ends up in Zoho.

Zoho allows you to create the HTML for such a form but it is really basic. One of the first things you will come against is the ability to mark some fields as required, Zoho’s code doesn’t do it.

So enter Gravity Forms, with all of its customisable goodness!

What you can do is this.

Create the form in Gravity, it can still store the entries in the WordPress database, notify you of the form entry etc.. but then you can also get it to send the data to Zoho.

You need to create a function, I generally use thesis so I put these in custom_functions.php – if you’re using another theme or framework, you’ll have to work out where you store your functions (perhaps functions.php in your template?)

Here is the code, I’ll explain what you need to customise below.

function post_to_crm($entry, $form){

    if($form["id"] != 3) //NOTE: replace 3 with your form id

        return;

?>

	<form method="post" action="http://crm.zoho.com/crm/WebToLeadForm"
name="form_to_crm" id="form_to_crm">
	<input type="hidden" name="First Name" value="<?php echo $entry["1.3"] ?>" />
	<input type="hidden" name="Last Name" value="<?php echo $entry["1.6"] ?>" />
	<input type="hidden" name="Email" value="<?php echo $entry["2"] ?>" />
	<input type="hidden" name="Phone" value="<?php echo $entry["3"] ?>" />
	<input type="hidden" name="LEADCF3" value="<?php echo $entry["4.1"] ?>" />
	<input type="hidden" name="LEADCF2" value="<?php echo $entry["5"] ?>" />

	<input name="xnQsjsdp" type="hidden" value="MHUKz-WiBZI$/" />
	<input name="xmIwtLD" type="hidden" value="5HGdaFP6TlkaxuV8tXZgy2-*B6-MHnNR/" />
	<input name="actionType" type="hidden" value="TGVhZHM=/" />

		</form>
		<script type="text/javascript">
		document.getElementById("form_to_crm").submit();
	</script>
<?php
}

add_action("gform_post_submission", "post_to_crm", 10, 2);

You need to replace the form id at the top of the PHP function with the id of the form, get this from the main Gravity screen where you can view all of your forms and choose one to edit.

The real trick to this is working out what to put in variables like $entry["5"]. The number here corresponds to the ID in the markup for the form when it is rendered. Fields like Name that are broken in two and will be considered field 1 but first will be something like 1.3 and last will be 1.6.

The name attribute in the input tag should simply be the name of the field that Zoho is expecting. A good way to work this out is have a look at the HTML that Zoho creates when making a web to lead form.

Other fields like a text area are more straight forward to work out.

One final tip, I couldn’t get it to work with Gravity’s Ajax enabled so I had to set the redirect of where to land the user when the form was done in the Zoho Web to form settings.

See how you go with all of that, if you have a question feel free to post a comment here and I’ll see if I know the answer!

Comments

  1. This is great!

    A couple of things, could you comment on:

    * I see that Zoho have ammended their web-2-lead processes to enforce https….will this affect your function in anyway?

    * I assume the above is only for ‘leads’ and not for ‘contacts’?

    * What if you wanted to auto-associate the above with an existing campaign. Would this be hard?

    Thanks
    Jason

    • Peter says:

      Hello Jason,

      You’re correct, zoho are updating on June 1 their system to only support https

      It’s a simple change just the url in the post needs to be updated to be https://

      Your second point, yes this is just for leads.

      If it’s just a field that you’re using to associate it with a campaign then you should be able to do it, what I did was generate the form in the zoho system and just look at the field names that it give you.

      PS

  2. Have you looked at cforms II plugin? It’s free and should be able to do the same thing. I just have to figure out how….

    • Hi there,

      Yes in fact used to use cforms; agree you should be able to get it to do similar. Gravity does have a lot of features though, we just use a developer license meaning you can install it on as many sites as you like….

  3. Please do let me know when the plugin is out! Thanks!

    BTW I paid someone to implement your info above but its not working. Can I pay you to help me get this working? I need to launch my site with this ASAP!

    Evan

    • Evan, it’s almost done – we are just finalising some testing – so won’t be long. Happy to let you know as soon as it’s ready.

      What kind of forms are you using on your WordPress site?

    • and yes, we can help you get it up and running. We’ll contact you via your email address.

  4. I’d like to know when this is available

  5. I’d like to know when this is available, also.

  6. Hi

    Excellent News.

    Please let me know when this is available.

  7. Can I also add…………..

    I use the google analytics parameters to track referrals, UTM_SOURCE, UTM_CAMPAIGN and so on.

    I am currently trying to find a way of capturing the information from the incoming URL and making it available so that when a gravity form is actioned I can pass the details in hidden field.

    Now if this plugin could add that functionality as well it would be useful to many people.

    We use this to track leads from our JV partners, we do not sell products, all leads are by enquiries.

    It could also be used to monitor PPC campaigns etc.

    Hope that makes sense.

    • Steve, you’re not going to believe this but we actually have just completed a plugin to do that as well!!

      It stores the cookie data as hidden fields in your form and send it through with the form entry, works really well :)

      We are working very hard to have these released shortly, I’ll drop you a note when its available.

      Cheers,

      Peter

  8. I’m so happy I found this.

    Please let me know when the plugin is completed. I’m excited and looking forward to using it.

    Thanks!

  9. I could really use the new Zoho CRM plugin for WP you talked about. Please notify me when you release it.

    Thanks!

  10. Hello all,

    The Gravity forms to Zoho CRM plugin is now available.

    As a bit of a treat to you guys that posted comments here and have waited, if you’re still interested in the plugin you can use the discount code “xmas” to get it for 50% off. That code will also give you the developer licence for unlimited number of domain names.

    See http://helpforwordpress.com/plugins

  11. Hey,

    Great article and very useful. The only question I have, is that I’m using more than one different form on my site to send to zoho. How do I change the php to make it so that I can use more than one form?

    Thanks so much,

    Victor

    P.S. I bought your plugin hoping that it might be able to do multiple forms, but it doesn’t seem to…

    • Hello Victor,

      We are working on an update to support multiple forms, will emails all users when it’s available.

      Thanks for supporting the plugin!

      Peter

      • Victor Thomas says:

        Thanks for the reply Peter.

        Is there a way to do it based on this page’s tutorial by adjusting the php? I’d really appreciate it.

        Thanks,

        Victor

        • Victor, well you could but I really would recommend using the update the plugin, trying hard to get this out asap. Certainly appreciate your interest in the plugin. Will get it done as soon as we can.

          PS

  12. Hi,

    We purchased the plugin and cant get it to work, posted this on the forum and we have not had any response at all. Can you please email me so I can get you access to fix it?

    Thanks!

    Evan

  13. Hi Peter
    Should http://helpforwordpress.com/plugins/ be a blank page?

  14. I think everything composed was very logical.

    But, consider this, suppose you typed a catchier post title?
    I mean, I don’t wish to tell you how to run your blog, however suppose you added a headline that makes people desire more? I mean Integrate Gravity Forms with Zoho CRM – Peter Shilling is a little boring. You should glance at Yahoo’s home
    page and see how they create news headlines to get viewers interested.
    You might add a video or a picture or two to grab people interested about
    everything’ve written. In my opinion, it might bring your blog a little bit more interesting.

  15. We see the ability to use repurchase agreements during periods of peak demand when solar resources are at their best.

    If Congress fails to renew or replace it, the industry’s robust growth will likely falter. Teragren represents the pioneer in bamboo flooring in North America and abroad, Western Wind said. First let me say that to qualify as a Solar Nebula Theory Energy source, it must be clean on both Criteria and Greenhouse Gas emissions.

  16. Since February 2008, 10 nations including New Zealand, Pakistan, Iceland and Costa Rica
    have vowed to reduce their emissions of greenhouse gases, has pledged to reduce Japan’s reliance on nuclear power. The fall in energy use across Britain is at least two of our ethanol plant debt per gallon by $0.

  17. Both are technologies in which Japan is a technological leader.
    Our risk managers and traders were diligently in the quarter, so we will continue to be in this world where,
    if you look at the middle of the range. Britain’s Environment Agency says the electricity generation sector is the second biggest abstracter after public water. We do it first physically. And that’s why we’ve started to see a lot more interest in it.

Speak Your Mind

*