Calculate how many of each persona you have for the companies in HubSpot CRM


ROI for completing this tutorial

  • Time: 24 minutes
  • Cost: $0
  • Return on investment: Get more customers by knowing which companies you should focus on

In the HubSpot CRM, you can associate a contact with a company.

This tutorial will let you see how many of each persona you have for every company.

Email the file to yourself

  1. Send yourself the required file for this tutorial

  2. Check your inbox
  3. Download the attachment from the email when it arrives
  4. No need to open the file, just move it to your Desktop

Create a free x10Hosting account

  1. Go to https://x10hosting.com/#create
  2. Follow the prompts on the screen
  3. Check I agree and click Submit

Confirm your x10Hosting account

  1. Check your inbox
  2. Open the Email Confirmation email from x10Hosting
  3. Click the confirmation link
  4. Click the Continue button
  5. Wait for your account to process
  6. Click the Continue button

Set up your x10Hosting account

  1. Enter your first name
  2. Click Continue
  3. Click Continue again
  4. Click Open cPanel
  5. Click the Add Website button
    • Choose a Website Name
    • No need to change the Domain
    • Leave Address Path blank
    • Click the Add Website button
  6. Click Continue to My Websites

Upload the file

  1. Go to https://x10hosting.com/sso/main
  2. Click Open cPanel
  3. In the top-right, click Switch Theme
    • Click Switch to cPanel x3 (or click Keep cPanel x3)
      • You may need to Sign in and click Open cPanel again
  4. Under Files, click File Manager
    • If Directory Selection pops up, select Web Root (public_html/www) then click Go
  5. In the top menu, click the Upload icon
  6. Click Choose File
  7. Find and select the calculate-personas-of-company-contacts.php file
  8. Wait until you see “complete” in the bottom-right status
  9. Click the Go Back to “/home/your_username/public_html” link

Open the file in the Code Editor

  1. In your File Manager, click calculate-personas-of-company-contacts.php to highlight it in blue
  2. Click the Code Editor icon
  3. If you see an option to “Select the character encoding to use when you open this file:”
    • Make sure utf-8 is selected
    • Click the Edit button

Add your HubSpot API key to the file

  1. Go to https://app.hubspot.com/keys/get
  2. Click Generate New Key (or View Key)
  3. Click Copy to clipboard
  4. Go back to the cPanel X Code Editor tab in your browser
  5. On line 3, paste your key between the quotation marks

Example:

<?php

$hubspotApiKey = "8bd83ea5-3222-4b40-9a9f-67f92c66e930";

Find the internal values of your Persona contact property

  1. Go back to where you copied your HubSpot API key
  2. In the top menu, on the far left drop-down, select Sales (not Marketing)
  3. In the top menu, click on Settings
  4. Click Manage properties to go to the Contact Properties screen
  5. Find the Persona property and click on it
    • Click Edit options
    • If you don’t see an INTERNAL VALUE column, click Show internal values

Add your persona internal values to the file

  1. Copy each internal value
  2. Go back to the Code Editor
  3. Starting on line 6, paste an internal value wherever you see REPLACE_WITH_PERSONA_INTERNAL_VALUE
  4. The file has “placeholders” for 10 personas (lines 6-15)
    • If you have less than 10 personas, delete any unused placeholder lines
    • If you have more than 10 personas, copy the last placeholder line and paste it as many times as you need

Example with 5 personas:

<?php

$hubspotApiKey = "8bd83ea5-3222-4b40-9a9f-67f92c66e930";

$personasAndTheirCorrespondingCompanyProperties = array(
  array('personaInternalValue' => 'persona_1', 'companyPropertyInternalName' => 'REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME'),
  array('personaInternalValue' => 'persona_2', 'companyPropertyInternalName' => 'REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME'),
  array('personaInternalValue' => 'persona_3', 'companyPropertyInternalName' => 'REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME'),
  array('personaInternalValue' => 'persona_4', 'companyPropertyInternalName' => 'REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME'),
  array('personaInternalValue' => 'persona_5', 'companyPropertyInternalName' => 'REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME'),
);

Create a new company property for each persona

  1. In the top menu of your HubSpot Sales screen, click Settings
  2. In the left sidebar, click Companies
  3. Click the Manage properties button
  4. Click Create new property
  5. Enter a Label that tells you what persona this is for
    • This could be something like “Marketing Mary” or “Veteran marketing professional”
  6. Click Save property
  7. Repeat steps 4 through 6 for each persona

Add these company properties to your file

  1. Click on each property you just created
  2. Copy the Internal name
  3. Go back to the Code Editor
  4. Starting on line 6, paste an internal name wherever you see REPLACE_WITH_COMPANY_PROPERTY_INTERNAL_NAME
  5. Make sure each property matches the persona that you pasted in earlier

Example with 5 personas:

<?php

$hubspotApiKey = "8bd83ea5-3222-4b40-9a9f-67f92c66e930";

$personasAndTheirCorrespondingCompanyProperties = array(
  array('personaInternalValue' => 'persona_1', 'companyPropertyInternalName' => 'marketing_mary'),
  array('personaInternalValue' => 'persona_2', 'companyPropertyInternalName' => 'salesperson_steve'),
  array('personaInternalValue' => 'persona_3', 'companyPropertyInternalName' => 'developer_dave'),
  array('personaInternalValue' => 'persona_4', 'companyPropertyInternalName' => 'project_manager_paula'),
  array('personaInternalValue' => 'persona_5', 'companyPropertyInternalName' => 'designer_debbie'),
);

Save and close the file

  1. In your Code Editor, click the Save button in the top-right
  2. Click the Close button in the top-right
  3. You can also close your cPanel File Manager

Test the file

  1. Open a new tab and paste http://MYDOMAIN.x10host.com/calculate-personas-of-company-contacts.php in the address bar
  2. Replace MYDOMAIN.x10host.com with your x10Hosting domain
  3. Press Enter to load the web page
  4. Wait a minute or two until you see Personas calculated successfully
  5. Go to a company in HubSpot to see if the persona counts were added correctly to the properties you created

Create a cron job to run the file on a daily basis

  1. Go to https://x10hosting.com/sso/main and click Open cPanel
  2. Scroll down to Advanced and click Cron Jobs
  3. Under Add a New Cron Job, use the Common Settings drop-down to select Once Per Day
  4. In the Command field, enter:
    wget http://MYDOMAIN.x10host.com/calculate-personas-of-company-contacts.php
  5. Replace MYDOMAIN.x10host.com with your x10Hosting domain
  6. Click the Add New Cron Job button

Conclusion

Congratulations. You have completed this tutorial.

Every night at midnight, the file will calculate how many of each persona you have for the companies in your HubSpot CRM. It will store each persona count in the company properties that you created.

This will help you get more customers by knowing which companies you should focus on.

 

Thanks to the following people for giving support and feedback for this tutorial: