PHPackages                             focuscanada/hubspot-custom-id - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. focuscanada/hubspot-custom-id

ActiveLibrary[API Development](/categories/api)

focuscanada/hubspot-custom-id
=============================

Sync a Custom ID property to Hubspot contacts

v1.0.4(9y ago)434MITPHPPHP &gt;=5.5.9

Since May 11Pushed 9y ago3 watchersCompare

[ Source](https://github.com/focuscanada/hubspot-custom-id)[ Packagist](https://packagist.org/packages/focuscanada/hubspot-custom-id)[ RSS](/packages/focuscanada-hubspot-custom-id/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Hubspot custom ID property sync script
======================================

[](#hubspot-custom-id-property-sync-script)

[![Version](https://camo.githubusercontent.com/ecd84300249ebb0e46ca48f01fc18d430ed4209e19dae4fafda34f480d503b4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f63757363616e6164612f68756273706f742d637573746f6d2d69642e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/focuscanada/hubspot-custom-id)[![License](https://camo.githubusercontent.com/d0b266b0be458fb078eab3cee975814c743795d68499490b1ea72caa77d9c479/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666f63757363616e6164612f68756273706f742d637573746f6d2d69642e7376673f6d61784167653d32353932303030)](https://github.com/focuscanada/hubspot-custom-id)[![Travis](https://camo.githubusercontent.com/5c85ca5e31bc9e4f402dafe9348193caa701463c4d28d9759daff925504af1a1/68747470733a2f2f7472617669732d63692e6f72672f666f63757363616e6164612f68756273706f742d637573746f6d2d69642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/focuscanada/hubspot-custom-id)[![Test Coverage](https://camo.githubusercontent.com/e3c73eecca48a5cc2400d2c9018d3a497921db03cc299333dee8fc5125e8e937/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f666f63757363616e6164612f68756273706f742d637573746f6d2d69642f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/focuscanada/hubspot-custom-id/coverage)

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.

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.

***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.

### Install

[](#install)

Using [composer](https://getcomposer.org/):

```
composer require focuscanada/hubspot-custom-id

```

### Usage

[](#usage)

##### 1. Create a new contact property for the custom ID

[](#1-create-a-new-contact-property-for-the-custom-id)

Name it something like `custom_id`, and make it a **single line text** field.

[![Custom property](https://camo.githubusercontent.com/eb80fe977f226816dc1cff4a44a15ca55319e0391d24f89718ee51092d76bb68/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f7279616e77696e636865737465722f636f64652f68756273706f742d637573746f6d2d69642f637573746f6d2d70726f70657274792e706e67)](https://camo.githubusercontent.com/eb80fe977f226816dc1cff4a44a15ca55319e0391d24f89718ee51092d76bb68/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f7279616e77696e636865737465722f636f64652f68756273706f742d637573746f6d2d69642f637573746f6d2d70726f70657274792e706e67)

##### 2. Create a new smart list

[](#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*)

[![list url](https://camo.githubusercontent.com/1a2a1a93c3760ee43a79bd07e374f19f359cf5902c91cdd90b1ff9bd8fafad2a/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f7279616e77696e636865737465722f636f64652f68756273706f742d637573746f6d2d69642f6c6973742d75726c2e706e67)](https://camo.githubusercontent.com/1a2a1a93c3760ee43a79bd07e374f19f359cf5902c91cdd90b1ff9bd8fafad2a/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f7279616e77696e636865737465722f636f64652f68756273706f742d637573746f6d2d69642f6c6973742d75726c2e706e67)

##### 3. Use it (example)

[](#3-use-it-example)

```
