Difference between revisions of "Marketing Endpoint"

From DreamFactory
Jump to: navigation, search
m
m
Line 28: Line 28:
 
Set your content type to `application/json` and POST your payload. The following properties are allowed/used in your payload:
 
Set your content type to `application/json` and POST your payload. The following properties are allowed/used in your payload:
  
| Name | Description         |
+
| Property | Type | Description |
| ------------- | ----------- |
+
| -------- | ---- | ----------- |
| Help      | Display the help window.|
+
| new_contact | boolean | Contact is new |
| Close    | Closes a window    |
+
| delete_contact| boolean| Contact will be opted-out of all lists|
 
+
| welcome_registration| boolean| Was from an optional Welcome page|
 
+
| welcome_skipped| boolean| Optional Welcome page was skipped|
 
+
| registration_skipped | boolean | Registration was skipped|
{| class="wikitable ddl-table" border="1"
+
| name | string | User name/full name (not email) |
|-
+
| first_name | string| First name |
! Property
+
| last_name| string| Last name|
! Type
+
| email| string| Email address|
! Description
+
| phone_number| string| Phone number|
|-
+
| company_name| string| Company name|
| new_contact
+
| title| string| Title|
| boolean
+
| address_1| string| Address 1|
| Contact is new
+
| address_2| string| Address 2|
|-
+
| city| string| City|
| delete_contact
+
| state_province| string| State/Province|
| boolean
+
| zip_postal_code| string| Zip/Postal code|
| Contact will be opted-out of all lists
+
| installation_source| string| A string indicating the source of the installation (i.e. Bitnami, GitHub, etc.). See InstallTypes enum!|
|-
+
| client_cookie_hubspotutk| string| The client's client hubspotutk cookie, if any|
| welcome_registration
+
| client_remote_addr| string| The client's client $_SERVER['REMOTE_ADDR']|
| boolean
+
| client_request_uri| string| The client's client $_SERVER['REQUEST_URI']|
| Was from an optional Welcome page
+
| client_referrer| string| The client's client $_SERVER['HTTP_REFERER']|
|-
+
| created| string| Creation date|
| welcome_skipped
+
| last_login| string| Last login date|
| boolean
+
| timezone| integer| Time zone. Defaults to 0|
| Optional Welcome page was skipped
+
|-
+
| registration_skipped
+
| boolean
+
| Registration was skipped
+
|-
+
| name
+
| string
+
| User name/full name (not email)
+
|-
+
| first_name
+
| string
+
| First name
+
|-
+
| last_name
+
| string
+
| Last name
+
|-
+
| email
+
| string
+
| Email address
+
|-
+
| phone_number
+
| string
+
| Phone number
+
|-
+
| company_name
+
| string
+
| Company name
+
|-
+
| title
+
| string
+
| Title
+
|-
+
| address_1
+
| string
+
| Address 1
+
|-
+
| address_2
+
| string
+
| Address 2
+
|-
+
| city
+
| string
+
| City
+
|-
+
| state_province
+
| string
+
| State/Province
+
|-
+
| zip_postal_code
+
| string
+
| Zip/Postal code
+
|-
+
| installation_source
+
| string
+
| A string indicating the source of the installation (i.e. Bitnami, GitHub, etc.). See InstallTypes enum!
+
|-
+
| client_cookie_hubspotutk
+
| string
+
| The client's client hubspotutk cookie, if any
+
|-
+
| client_remote_addr
+
| string
+
| The client's client $_SERVER['REMOTE_ADDR']
+
|-
+
| client_request_uri
+
| string
+
| The client's client $_SERVER['REQUEST_URI']
+
|-
+
| client_referrer
+
| string
+
| The client's client $_SERVER['HTTP_REFERER']
+
|-
+
| created
+
| string
+
| Creation date
+
|-
+
| last_login
+
| string
+
| Last login date
+
|-
+
| timezone
+
| integer
+
| Time zone. Defaults to 0
+
|}
+
  
 
The following properties are inferred by the payload and passed on to HubSpot:
 
The following properties are inferred by the payload and passed on to HubSpot:
  
{| class="wikitable ddl-table"
+
| Property | Type | Description |
|-
+
| -------- | ---- | ----------- |
! Property
+
| mobile_lead | boolean | Calculated |
! Type
+
| local_installation | boolean | Calculated |
! Description
+
| local_installation_skipped | boolean | Calculated |
|-
+
| website_lead_source | string | Calculated |
| mobile_lead
+
| hs_email_optout | string | Calculated |
| boolean
+
| Calculated
+
|-
+
| local_installation
+
| boolean
+
| Calculated
+
|-
+
| local_installation_skipped
+
| boolean
+
| Calculated
+
|-
+
| website_lead_source
+
| string
+
| Calculated
+
|-
+
| hs_email_optout
+
| string
+
| Calculated
+
|}
+

Revision as of 23:19, 23 September 2015

Configuration

In `common.config.php` there are a few configuration options. These are shown in the snippet below:

//*************************************************************************
//* Marketing
//*************************************************************************
'marketing.lead-endpoint'    => 'https://forms.hubspot.com/uploads/form/v2/247169/d48b5b8e-2274-488b-9448-156965d38048',
'marketing.blacklist'        => array('[email protected]', '[email protected]', '[email protected]',),
/** Installation sources */
'marketing.install-sources'  => array(
    /**
     * Format: [ "<hubspot_id>" => "<pattern>", ... ]
     * Pattern is used in stripos comparison of "installation_source" and/or "client_referrer"
     */
    'bitnami'       => 'bitnami',
    'standalone'    => 'standalone',
    'deb'           => 'deb',
    'rpm'           => 'rpm',
    'html5landing'  => '/html5landing',
    'nativelanding' => '/nativelanding',
),

The options are used to control where on HubSpot the contact is posted and which emails to exclude. There is an additional *install source* translation that is attempted via pattern matching. The patterns to match, and their associated `installation_source` value are in the `install-sources` config array.

Payload

Set your content type to `application/json` and POST your payload. The following properties are allowed/used in your payload:

| Property | Type | Description | | -------- | ---- | ----------- | | new_contact | boolean | Contact is new | | delete_contact| boolean| Contact will be opted-out of all lists| | welcome_registration| boolean| Was from an optional Welcome page| | welcome_skipped| boolean| Optional Welcome page was skipped| | registration_skipped | boolean | Registration was skipped| | name | string | User name/full name (not email) | | first_name | string| First name | | last_name| string| Last name| | email| string| Email address| | phone_number| string| Phone number| | company_name| string| Company name| | title| string| Title| | address_1| string| Address 1| | address_2| string| Address 2| | city| string| City| | state_province| string| State/Province| | zip_postal_code| string| Zip/Postal code| | installation_source| string| A string indicating the source of the installation (i.e. Bitnami, GitHub, etc.). See InstallTypes enum!| | client_cookie_hubspotutk| string| The client's client hubspotutk cookie, if any| | client_remote_addr| string| The client's client $_SERVER['REMOTE_ADDR']| | client_request_uri| string| The client's client $_SERVER['REQUEST_URI']| | client_referrer| string| The client's client $_SERVER['HTTP_REFERER']| | created| string| Creation date| | last_login| string| Last login date| | timezone| integer| Time zone. Defaults to 0|

The following properties are inferred by the payload and passed on to HubSpot:

| Property | Type | Description | | -------- | ---- | ----------- | | mobile_lead | boolean | Calculated | | local_installation | boolean | Calculated | | local_installation_skipped | boolean | Calculated | | website_lead_source | string | Calculated | | hs_email_optout | string | Calculated |