(webuser, properties)
Update or create a new "contact" on hubspot. Record that the user has
    created an account on HQ.

    properties is a dictionary mapping property names to values.
    Note that property names must exist on hubspot prior to use.
Update or create a new "contact" on hubspot. Record that the user has
    created an account on HQ.
Update or create a new contact on hubspot . Record that the user has created an account on HQ .
def _track_on_hubspot(webuser, properties):
    """
    Update or create a new "contact" on hubspot. Record that the user has
    created an account on HQ.

    properties is a dictionary mapping property names to values.
    Note that property names must exist on hubspot prior to use.
    """
    if webuser.analytics_enabled:
        # Note: Hubspot recommends OAuth instead of api key
        data = {'properties': [{'property': k, 'value': v} for k, v in properties.items()]}
        _hubspot_post(
            url="https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{}".format(
                six.moves.urllib.parse.quote(webuser.get_email())
            ),
            data=json.dumps(data),
        )
def _track_on_hubspot ( webuser , properties ) : if webuser . analytics_enabled : # Note: Hubspot recommends OAuth instead of api key data = { 'properties' : [ { 'property' : k , 'value' : v } for k , v in properties . items ( ) ] } _hubspot_post ( url = "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{}" . format ( six . moves . urllib . parse . quote ( webuser . get_email ( ) ) ) , data = json . dumps ( data ) , )