Skip to content

Instantly share code, notes, and snippets.

@zarathustra323
Created June 7, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarathustra323/ff523efc921575fb341e54cda07be325 to your computer and use it in GitHub Desktop.
Save zarathustra323/ff523efc921575fb341e54cda07be325 to your computer and use it in GitHub Desktop.

Firehouse Data Structure

Form Submissions

Request More Information (Inquiry)

This form is submitted when a user wishes to request more information about a company or company's product. It can be submitted by an anonymous user, a previously identified (but not logged-in) user, or a logged-in user. The submission data consists of:

  • Standard identity text fields, such as name, company name, etc.
  • Omeda demographic questions/answers, such as "Primary Business Category," etc.
  • The inquired Company
  • The inquired Product's primary section/category information.

Sample Payload

The submission payload is comprised of identity, company, section, and meta objects. Please refer to the comments below for more information on each field.

/**
 * The Request More Information (Inquiry) submission payload.
 *
 * @prop {object} meta The metadata about the form submission.
 * @prop {object} company The company that was inquired upon by the user.
 * @prop {object} section The primary section of the inquired product.
 * @prop {object} identity The user data that was submitted.
 */
const payload = {
  /**
   * @prop {string} brand The Omeda brand the data should be applied to.
   * @prop {number} timestamp The UNIX timestamp of the submission.
   * @prop {string} site The website where the form was accessed.
   */
  meta: {
    brand: 'cps',
    timestamp: 1528389508,
    site: 'www.firehouse.com',
  },
  /**
   * @prop {string} id The internal (Southcomm) company ID.
   * @prop {string} name The company name.
   */
  company: {
    id: '21001206',
    name: 'Firecom',
  },
  /**
   * @prop {string} id The internal (Southcomm) section ID.
   * @prop {string} name The section name.
   */
  section: {
    id: '58126',
    name: 'Tech & Comm > Radios, Pagers & Accessories',
  },
  /**
   * Note: any unknown/unset fields will be set to `null`.
   * If no `answers` were provided, the field will be an empty array.
   *
   * @prop {string} id          The internal (Southcomm) user id.
   * @prop {string} omedaId     The user's Omeda ID, if known.
   * @prop {string} givenName   The user's first name.
   * @prop {string} familyName  The user's last name.
   * @prop {string} email       The user's email address.
   * @prop {string} title       The user's job title (free-form text).
   * @prop {string} companyName The user's company name.
   * @prop {string} phoneNumber The user's phone number.
   * @prop {string} regionCode  The user's state or province.
   *                            Two characters, e.g. WI.
   * @prop {string} countryCode The user's country.
   *                            Follows ISO 3166 alpha3, e.g. USA.
   * @prop {string} postalCode  The user's postal code.
   *                            For USA and CAN only.
   * @prop {object[]} answers   An array of user demographic answers.
   *                            Will only include Omeda questions.
   */
  identity: {
    id: '5b194ac338ab46de3ba10da7',
    omedaId: '1017767741',
    givenName: 'Jacob',
    familyName: 'Bare',
    email: 'jbare@southcomm.com',
    title: 'Director, Analytics and Engineering',
    companyName: 'Southcomm Inc.',
    phoneNumber: '8005477377',
    regionCode: 'WI',
    countryCode: 'USA',
    postalCode: '53538',
    answers: [
      // Answer 1
      {
        question: {
          name: 'FH Reporting - Business (Type of Dept)',
          identifier: '5072851', // Omeda Demographic ID
        },
        choice: {
          name: 'Other Fire Dept',
          identifier: '5075895', // Omeda DemographicValue ID
        },
      },
      // Answer 2
      {
        question: {
          name: 'FH Reporting - Job Title',
          identifier: '5072852',
        },
        choice: {
          name: 'Other Fire Officials',
          identifier: '5075909',
        },
      },
    ],
  },
};

Content Download

This form is submitted when a user wishes access/download a gated content item. A successful submission generally results in allowing the user to download a whitepaper, case study, or similar type of asset. It can be submitted by an anonymous user, a previously identified (but not logged-in) user, or a logged-in user. The submission data consists of:

  • Standard identity text fields, such as name, company name, etc.
  • Omeda demographic questions/answers, such as "Primary Business Category," etc.
  • The downloaded content, such as type, title, etc.
  • The downloaded content's primary section/category.

Sample Payload

The submission payload is comprised of identity, content, section, and meta objects. Please refer to the comments below for more information on each field.

/**
 * The Content Download submission payload.
 *
 * @prop {object} meta The metadata about the form submission.
 * @prop {object} content The content that accessed by the user.
 * @prop {object} section The primary section of the accessed content.
 * @prop {object} identity The user data that was submitted.
 */
const payload = {
  /**
   * @prop {string} brand The Omeda brand the data should be applied to.
   * @prop {number} timestamp The UNIX timestamp of the submission.
   * @prop {string} site The website where the form was accessed.
   */
  meta: {
    brand: 'cps',
    timestamp: 1528389508,
    site: 'www.firehouse.com',
  },
  /**
   * @prop {string} id The internal (Southcomm) content ID.
   * @prop {string} title The content title.
   * @prop {string} type The content type.
   */
  content: {
    id: '11320362',
    title: 'Firehouse Weekly Drill 147 (PDF)',
    type: 'Document',
  },
  /**
   * @prop {string} id The internal (Southcomm) section ID.
   * @prop {string} name The section name.
   */
  section: {
    id: '58037',
    name: 'Home',
  },
  /**
   * Note: any unknown/unset fields will be set to `null`.
   * If no `answers` were provided, the field will be an empty array.
   *
   * @prop {string} id          The internal (Southcomm) user id.
   * @prop {string} omedaId     The user's Omeda ID, if known.
   * @prop {string} givenName   The user's first name.
   * @prop {string} familyName  The user's last name.
   * @prop {string} email       The user's email address.
   * @prop {string} title       The user's job title (free-form text).
   * @prop {string} companyName The user's company name.
   * @prop {string} countryCode The user's country.
   *                            Follows ISO 3166 alpha3, e.g. USA.
   * @prop {object[]} answers   An array of user demographic answers.
   *                            Will only include Omeda questions.
   */
  identity: {
    id: '5b194ac338ab46de3ba10da7',
    omedaId: '1017767741',
    givenName: 'Jacob',
    familyName: 'Bare',
    email: 'jbare@southcomm.com',
    title: 'Director, Analytics and Engineering',
    companyName: 'Southcomm Inc.',
    countryCode: 'USA',
    answers: [
      // Answer 1
      {
        question: {
          name: 'FH Reporting - Business (Type of Dept)',
          identifier: '5072851', // Omeda Demographic ID
        },
        choice: {
          name: 'Other Fire Dept',
          identifier: '5075895', // Omeda DemographicValue ID
        },
      },
      // Answer 2
      {
        question: {
          name: 'FH Reporting - Job Title',
          identifier: '5072852',
        },
        choice: {
          name: 'Other Fire Officials',
          identifier: '5075909',
        },
      },
    ],
  },
};

Event Tracking

Events are fired when an identified user views a piece of content on a website. For now, we will only send events for users that have an Omeda customer ID present. Event payloads consist of:

  • The Omeda customer ID
  • The content type and ID viewed
  • The content's primary section/category information
  • The company information the content is related to (if such a relationship exists)

Sample Payload

The event payload is comprised of content, section, company and meta objects. Please refer to the comments below for more information on each field.

/**
 * A content view event payload
 *
 * @prop {object} meta The metadata about the event.
 * @prop {object} content The content that was viewed the user.
 * @prop {object} section The primary section of the viewed content.
 * @prop {object} company The company info of the viewed content.
 */
const payload = {
  /**
   * @prop {string} brand The Omeda brand the data should be applied to.
   * @prop {string} omedaId The Omeda ID of the user who viewed.
   * @prop {number} timestamp The UNIX timestamp of when the view occured.
   * @prop {string} site The website where the view occurred.
   */
  meta: {
    brand: 'cps',
    omedaId: '1017767741',
    timestamp: 1528389508,
    site: 'www.firehouse.com',
  },
  /**
   * @prop {string} id The internal (Southcomm) content ID.
   * @prop {string} type The content type.
   */
  content: {
    id: '21006199',
    type: 'Product',
  },
  /**
   * @prop {string} id The internal (Southcomm) section ID.
   * @prop {string} name The section name.
   */
  section: {
    id: '58107',
    name: 'Safety & Health > Scene Lighting',
  },
  /**
   * Not all content is related to a company.
   * If the content does not have a company, this field
   * will *not* be present.
   *
   * @prop {string} id The internal (Southcomm) company ID.
   * @prop {string} name The company name.
   */
  company: {
    id: '10063076',
    name: 'Streamlight, Inc.',
  },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment