In this integration guide you will learn how to add the Service Objects Global Address Complete (GAC) web service into your WordPress website. GAC will take your address form to the next level by providing type ahead address suggestions along with address validation.
- Install Code Snippets plugin
- Create web form (or use an existing one)
- Gather the ID’s of the form fields. E.g. “address”, “city”, “state”, “zip”
- Add [gac_integration] to your web page in order to use the Code Snippets plugin
- Create Code Snippet
- Map your form ID’s to our input fields
- Add in your license key to the line that says “var CustomKey =”
- *When using a production license key* – set “isTrial: false” and change your CustomKey to the provided production key
Plugin – Code Snippets:
Once installed your Plugins list should include the following:
GAC in Action
Basic Input Form:
Below is an example address form that has GAC added to the Address input field. When a user starts to type into the Address field, they are provided with autocomplete suggestions.
Starting to Type:
When a user finds their address, they can select from the drop down and the rest of the form will be auto populated.
Option Selected and Fields Auto Populated:
The auto populated address fields will help standardize your input data and reduce human error.
Code Behind Form HTML
At the bottom of the form you will see [gac_integration]. This shortcode should be added to your form to load in the Code Snippet that will be created in the next step.
Text version of form:
<form> <label for="address">Address:</label> <input type="text" id="address" name="address"> <label for="city">City:</label> <input type="text" id="city" name="city"> <label for="state">State:</label> <input type="text" id="state" name="state"> <label for="postalcode">Postal Code:</label> <input type="text" id="postalcode" name="postalcode"> </form>[gac_integration]
For a detailed breakdown of the field mappings and optional parameters, please see our Developer Guide:
Text Version of Code: