2017 © Pedro Peláez
 

library hubspot-custom-id

Sync a Custom ID property to Hubspot contacts

image

focuscanada/hubspot-custom-id

Sync a Custom ID property to Hubspot contacts

  • Tuesday, August 2, 2016
  • by ryanwinchester
  • Repository
  • 2 Watchers
  • 2 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Hubspot custom ID property sync script

Version License Travis Test Coverage, (*1)

You find you need to do anything fancy but there is no way to uniquely identify users apart from their email address? Well here is a hokey-pokey work-around., (*2)

What this does is just base64 encodes the vid property to a custom property that we can actually use. I don't like the idea of directly exposing the vid. So this obfuscates it slightly. However, it is still easy to decode in pretty much any programming language as far as I am aware of., (*3)

One example of a use case is adding it as query string in a url from a link in an email. We can then use it to identify the user that clicked the email on the target page., (*4)

Install

Using composer:, (*5)

composer require focuscanada/hubspot-custom-id

Usage

1. Create a new contact property for the custom ID

Name it something like custom_id, and make it a single line text field., (*6)

Custom property, (*7)

2. Create a new smart list

You will need to create a new smart list that contains only contacts where the custom_id property is unknown. Remember the ID of that list. (It should be the number as the last component of the url when editing the list), (*8)

list url, (*9)

3. Use it (example)
<?php

require __DIR__.'/vendor/autoload.php';

use Focus\HubspotId\SyncService;
use Fungku\HubSpot\HubSpotService;

$hubspot_api_key = 'demo';
$hubspot_list_id = '12345';
$hubspot_property = 'custom_id';

$hubspot = HubSpotService::make($hubspot_api_key);
$sync = new SyncService($hubspot, $hubspot_property);

$sync->syncList($hubspot_list_id);
4. Make a workflow (optional)

If you don't want it to run just as something like a cron job, or manually. Then you can deploy it to a server somewhere and create a workflow to access your script as a webhook., (*10)

Credits

The Versions

02/08 2016

dev-master

9999999-dev

Sync a Custom ID property to Hubspot contacts

  Sources   Download

MIT

The Requires

 

The Development Requires

02/08 2016
17/05 2016
11/05 2016