You are here

function hubspot_help in HubSpot 6.2

Same name and namespace in other branches
  1. 8 hubspot.module \hubspot_help()
  2. 6 hubspot.module \hubspot_help()
  3. 7 hubspot.module \hubspot_help()
  4. 3.x hubspot.module \hubspot_help()

Implements hook_help() for the admin help page.

File

./hubspot.module, line 417
Sends Webform results to HubSpot's Leads API by using Webform's provided hooks.

Code

function hubspot_help($path, $arg) {
  $output = '';
  switch ($path) {
    case 'admin/help#hubspot':
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The HubSpot module provides leads integration with the HubSpot API, allowing forms created with the Webform module to submit their data to HubSpot for leads tracking. It also allows you to easily embed the HubSpot JavaScript tracking code in your site to track the visits of each lead. Further information is available in the Drupal <a href="http://drupal.org/node/1195370">handbook pages for this module.</a>') . '</p>';
      $output .= '<h3>' . t('Creating a HubSpot Webform') . '</h3>';
      $output .= '<p>' . t("To have a Webform's data sent to HubSpot for leads tracking, complete the following steps:") . '</p>';
      $output .= '<ol>';
      $output .= '<li>' . t('Log in to your HubSpot account and visit the Settings page. Click the HubSpot Lead API link under Lead Management.') . '</li>';
      $output .= '<li>' . t('Press Add New Form and specify the form name, email list, and lead nurturing campaign as desired.') . '</li>';
      $output .= '<li>' . t('Submit the form. HubSpot will now provide an API POST URL; save this somewhere.') . '</li>';
      $output .= '<li>' . t('In your Drupal admin, use the Add content page to create a new Webform. Enter as many questions ("components") as you\'d like. Name them according to the "Form field keys" section below.') . '</li>';
      $output .= '<li>' . t('Finally, create a component named "hubspot" with the type "HubSpot POST URL". Supply the API POST URL in the box provided, select which form fields should be sent to HubSpot, and save the form.') . '</li>';
      $output .= '</ol>';
      $output .= '<p>' . t('The Webform will now automatically send any submissions directly to HubSpot via the POST URL you provided. You may customize, theme, or alter the form as much as you like, so long as the HubSpot POST URL field remains.') . '</p>';
      $output .= '<p>' . t('Please note that HubSpot applies a 500-character limit to each form field submitted, so you may want to set the "Maxlength" setting on the Webform fields appropriately.') . '</p>';
      $output .= '<h3>' . t('Form field keys') . '</h3>';
      $output .= '<p>' . t('Each Webform component\'s "field key" specifies what the field will be named when sent to HubSpot. Certain field keys have significance with HubSpot. For example, submitting a field with the key "FirstName" allows HubSpot to automatically recognize it as the person\'s first name when displaying the lead information. Here is a list of HubSpot-recognized field keys:') . '</p>';
      $output .= '<dl>';
      $output .= '<dt>' . t('FirstName, LastName, and FullName') . '</dt>';
      $output .= '<dd>' . t('Use FirstName or LastName to send those fields separately; send FullName for HubSpot to automatically split the name into first and last names.') . '</dd>';
      $output .= '<dt>' . t('Email, Phone, Fax, Website, and TwitterHandle') . '</dt>';
      $output .= '<dd>' . t("Specify these field keys to get the user's contact information recognized by HubSpot.") . '</dd>';
      $output .= '<dt>' . t('Company, NumberEmployees, AnnualRevenue, and JobTitle') . '</dt>';
      $output .= '<dd>' . t("Capture the user's employment information.") . '</dd>';
      $output .= '<dt>' . t('Address, City, State, ZipCode, Country') . '</dt>';
      $output .= '<dd>' . t("Capture the user's location.") . '</dd>';
      $output .= '<dt>' . t('Message') . '</dt>';
      $output .= '<dd>' . t('Allow the user to send a custom message.') . '</dd>';
      $output .= '</dl>';
      $output .= '<p>' . t('Specify these as the <strong>Field Key</strong> when adding components in your form. The field key is not shown to users filling out the form, but only used by HubSpot to display the data; the "Label" field specifies what your users will see.') . '</p>';
      $output .= '<p>' . t('Note that you may provide other custom fields with any field key you like, if you have other data you wish to collect. HubSpot will store all data sent to it and display it in the "Form Data" tab when viewing each lead.') . '</p>';
      $output .= '<p>' . t("Also, if you're using HubSpot's Salesforce integration, you must use field keys that correspond to the field's API Name in Salesforce.") . '</p>';
      $output .= '<h3>' . t('HubSpot Javascript tracking code') . '</h3>';
      $output .= '<p>' . t('HubSpot supports using a JavaScript tracking system to analyze potential leads on your site. You can get the JavaScript code from your HubSpot settings, under External Site Traffic Logging, and paste it into the HubSpot integration settings page in Drupal to have it automatically included on every page.') . '</p>';
      break;
    case 'node/%/webform':
      $output .= '<p>' . t('If you\'d like this form\'s results to be posted to HubSpot\'s leads tracking system, make sure it has a "HubSput POST URL" component filled in with the information from the HubSpot Lead API page in your HubSpot settings.') . '</p>';
      break;
  }
  return $output;
}