Creating a HubSpot Action Hub Integration

keep
actionhub
(ryan.grojean) #1

I’ve been a part of more and more conversations lately where companies are trying to understand their customers and market to them better, especially in the online retail space (even more specifically the order online, pick up in store). This post is intended to show how you can integrate Looker with HubSpot via GCP cloud functions to create more data-driven lists of contacts.

First, major thank you to @jesse.carah and his post here on writing back to a BigQuery database with Looker action hub. This tutorial will be utilizing the majority of that post as the basis for the HubSpot Integration. Please familiarize yourself with the " Creating the Action List Cloud Function" and " Creating the Action Form Cloud Function" section of that post, in an effort to not re-invent the wheel I will not cover those sections again in detail as they are very closely mimicked for the HubSpot integration.

For the Action List function, you can use the below code. An important thing to note is, the “HubSpot API Key.” You will be prompted to enter your HubSpot API key when you add the Action to Looker. The execution code relies on the API key for access to your HubSpot instance:

Action List Code
def action_list(request):
	r = request.get_json()
	print(r) # so it shows up in logs
    
	response = """
        {
       	"integrations": [{
       		"name": "hubspot",
       		"label": "Update Contact in Hubspot",
       		"supported_action_types": ["query"],
       		"url": "https://us-central1-hubspottesting.cloudfunctions.net/action_execute",
       		"form_url": "https://us-central1-hubspottesting.cloudfunctions.net/action_form",
            "icon_data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArwAAAHVCAYAAAATqShMAAAZo0lEQVR42u3d0XXbuNYG0FsCS+B0wBJYAktgCXy6z+xAJagElaASVIJK0Mv/Pn+4guQ6jmzLNikCB3uvdZ4mM5MIQPgZOgD/8x8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8vF///2n+1H9j5pf1OlHnV/U4cU/G9Ovb3x6AADkFm7bFFiPP+ryo/79Zt1SOF6CcO8TBgBgj5DbpR3aNQLuIwF4CdODTx4AgC1DbpN2cp8Rcj8Kv60RAQBgzaA7p7D5b0Z11vIAAEDEoCv4AgDw7bA7FhB0X9fRLQ8AAHwUdNu0Y/pvobWE9MlIAgBwL+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GwFXYBAIRdYRcAAGFX2AUAQNgVdgEA2DTsjoKtsAsAEDXsdoKtsAsAEDXsLi+VuAi3wi4AQNTAexBuhV0AgKhhVyuDsAsAEDrwngVcYRcAIGrY7QVcYRcAIHLgtbsr7AIAhA27rZAr7AIARA68bmYQdgEAQgfem7Ar7AIARA27Dqv995+TmQAAEDfwamewuwsAEDrweo3wf/+5mQkAAHEDr8NqP6s1GwAA4oVd/bv/q8GMAACIF3gnQfd3zWYEAEC8wDsLum5qAACIHHhPgu7vOpsRAADxAu9Z0BV4AQAE3jrqakYAAAi8ocuMAAAQeAVeAAAEXj28AAAIvAIvAABPCLzu4RV4AQAEXm9aAwCg1MDbC7q/azIjAADiBd5W0P1dvRkBABAz9F6FXVeSAQBEDrxHgdeBNQCAyIF3FHj17wIARA68jcD7T2cmAADEDr2nisPuxQwAAIgfeAftDAAARA+9Nd7WcFtaOow+AEAdgXf0djUAAKKH3qvdXQAAIgfe0e4uAADRQ++5grB7NdIAAPUG3q6CwNsbaQCAukPvFDjsHowwAABRX0bhJRMAAPwOvMsrhy9uZQAAIHrovQUJu50RBQDgXujtCg+9wi4AAA+F3quwCwBA5NBbWk/vRdgFAOArofdYQNg9OaAGAMB3gu+QaV/v8nuajBAAAGuE3jazu3qXVyK3RgYAgLWDb5/C5l5BdzlMNxgJAACiBd/lUNrokwcA4NnBd2l1OGx0jdktHZpz+wIAAFmE3+X+3in1+t6+GHCXXeNZyAUAoIQA3KTWhyGF2Hs1pF/T+sQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqvP/xpkrdeeUrUQAAAAASUVORK5CYII=",
        	"required_fields": [],
       		"params": [{
       			"name": "api_key",
       			"label": "API Key",
       			"required": true
       		},{
       			"name": "hub_key",
       			"label": "HubSpot API Key",
       			"required": true
       		}],
           "supported_formats": ["json"],
           "supported_formattings": ["unformatted"],
           "supported_visualization_formattings": ["noapply"]
       	}]
       }

	"""
	return response

For the Action Form code, you can use this:

Action Form Code
import json

def action_form(request):
    
    form = """
       [{
            "name":"propValue",
            "label":"Identifier",
            "description":"** EMAIL MUST BE FIRST COLUMN IN RESULT SET **",
            "type":"text",
            "default":"Value to create a filtered list",
            "required":true
       }]
    """
    return form

This final section is the code most specific to HubSpot. For this example we are using Looker to update a contact property. The code, as it is, updates a custom property called “lookertag”. You can create the lookertag property in your instance, or choose to update an existing property by changing that property in the code. This script will update contacts that already exists as well as add the contacts if they don’t.

Action Execute Code
import requests
import json
import datetime

#HubSpot API says it works best with increments of 100
def chunks(data):
    for i in range(0, len(data), 100):
        yield data[i:i+100]

def constructPropUpdate(contacts):
    contacts_json = contacts.get_json()
    print(contacts_json)
    api_key = contacts_json['data']['api_key']
    hub_key = contacts_json['data']['hub_key']
    query_data = json.loads(contacts_json['attachment']['data'])

    propValue = contacts_json['form_params']['propValue']
    masterList = []
    propUpdateUrl = "https://api.hubapi.com/contacts/v1/contact/batch/?hapikey="+hub_key
    headers = {}
    headers["Content-Type"] = "application/json"
    
    today = datetime.datetime.today()
    today.strftime('%m/%d/%Y')

    for datum in query_data:
        #Transform email into format expected by HubSpot API
        propDict = {}
        keys = list(datum.keys())
        keys = keys[0]
        propDict["email"] = datum[keys]
        propDict["properties"] = []
        propUpdate = {}
        propUpdate["property"] = "lookertag"
        propUpdate["value"] = contacts_json['form_params']['propValue'] + " " + today.strftime('%m/%d/%Y')
        propDict["properties"].append(propUpdate)
        masterList.append(propDict)
        
    #parse the data into 100 length chunks    
    contact_chunks = list(chunks(masterList))
    
    response = []
    for chunk in contact_chunks:
        resp = requests.post(propUpdateUrl,data=json.dumps(chunk),headers=headers)
        
        response.append(resp.status_code == 202)

    if False not in response:
        return '{"looker": {"success": true}}'

In this example, we have filtered to customers that have purchased more than one Levi’s product in the last 4 weeks. We then provide Looker a value to set for the lookertag property:

You can determine if you want this to be a one time thing, on going on an interval, etc.

Once you click send or schedule, you will see those contacts in HubSpot and you can now leverage the lookertag value to create either a static or active HubSpot List by filtering on that property:

Mix it with a “Last modified date” filter, and now your Looker schedule will update the “Levi’s Lovers” List, and your HubSpot “Last modified date” filter will drop off contacts so they don’t continue to receive the promotion.

The HubSpot API provides a ton of end points that you could easily integrate following this same process, so hopefully this example spurs ideas on how you can create and manage more tailored HubSpot lists. Taking it one step further, modify this action to also write back to BigQuery so you can easily monitor and assess the performance of campaigns in Looker.

3 Likes

The Podium — February 27th, 2019