# Marketo

## Sync with Marketo

<details>

<summary>Before you can connect GrowSurf to Marketo, you will first need to create a new Custom Service for your Marketo account. Click here to view step-by-step instructions.</summary>

Open up your Marketo account, then navigate to *Admin > Security > Users & Roles > Roles > Create New Role*. Then enter in the following information (reference the screenshot below):

* **Role Name**: GrowSurf
* **Description**: API Role specifically made for the GrowSurf Marketo integration.
* **Permissions**: Access API (35 of 35)

<img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FnmUjnR9jSnTn9tA4quTu%2F00%20-%20Roles%2001.png?alt=media&#x26;token=b61b2cfa-8353-4fb0-b1e4-271662d3d856" alt="" data-size="original">

Then navigate to *Admin > Security > Users & Roles > Users > Invite New User*. Then enter in the following information (reference the screenshot below):

* **Email**: `growsurf@yourcompany.com` (this can be replaced with any email address of your choosing)
* **First Name**: GrowSurf
* **Last Name**: Integration
* **Reason:** The Marketo user that will be used for the GrowSurf Marketo integration

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FDeJAYYUpJZrFf7lFkpAK%2F01%20-%20Users%2001.png?alt=media\&token=ee46ab66-fab4-4682-8237-14b3ac3b6418)

Then click the Next button. In *Step 2: Permissions*, set the following fields (reference the screenshot below):

* **Roles:** GrowSurf
* **API Only**: Enable this checkbox

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2Fiu78DtXEFB2GSi7ToSNK%2F02%20-%20Users%2002.png?alt=media\&token=5d5c5108-3988-4156-a7e2-8df1b752091d)

Then click the Next button. In *Step 3: Message*, click the Send button (reference the screenshot below).

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2Fnobmr521qMUW3K3jQFQK%2F03%20-%20Users%2003.png?alt=media\&token=3ca775fa-abb4-4b6b-81e4-c7aa5eaddfda)

Once you've added the new user, it's time to set up the custom service. Navigate to *Admin > Integration > LaunchPoint > New Service.* Then enter in the following information (reference the screenshot below):

* **Display Name**: GrowSurf
* **Service**: Custom
* **Description**: Service for the GrowSurf Marketo integration
* **API Only User**: `growsurf@yourcompany.com` (this should be the user that you set from the previous steps)

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FXIbkOTYbFOBZf4MdwfMG%2F04%20-%20Launchpoint%2001.png?alt=media\&token=b4c4627a-c740-41f4-9921-f0a731f8423e)

Then click Create. Your service should now be available to view -- click on GrowSurf and write down the *Client ID* and *Client Secret* for later (you will need to enter this information into GrowSurf later). Reference the screenshot below:

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FJG9wvg2d3bJ4aIdIjh1l%2F05%20-%20Credentials%2001.png?alt=media\&token=d66f2a77-0ba3-439a-a5d1-e71cc43b5166)

Lastly, navigate to *Admin > Integration > Web Services.* Scroll to the REST API section and write down both URLs for *Endpoint* and *Identity* (you will need to enter this information into GrowSurf later). Reference the screenshot below:

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FaDzsg1MvWsOkconK3KyY%2F06%20-%20Credentials%2002.png?alt=media\&token=7d916bdd-7d04-4680-9d4a-241230249ee2)

#### **Need help?**

If you run into any issues during this setup phase, please see Marketo's Custom Services documentation [here](https://developers.marketo.com/rest-api/custom-services/) or reach out to GrowSurf support for assistance [here](https://app.growsurf.com/settings#contact_support).

</details>

**Step 1:** In *Campaign Editor > 4. Options > Integrations*, open the Marketo integration card and enter your [client ID and client secret](https://developers.marketo.com/rest-api/authentication/). Next, enter the [REST API Endpoint URL and Identity URL](https://developers.marketo.com/rest-api/base-url/).

{% hint style="info" %}
IMPORTANT: Because the GrowSurf data sync to Marketo only occurs *after* you have connected with the integration, it is imperative to connect with the integration *BEFORE* importing participants.\
\
[Click here](https://support.growsurf.com/article/385-how-can-i-sync-my-growsurf-participants-to-my-esp) to see remedy options if you have already imported participants into your campaign but would like to sync their GrowSurf data to Marketo.
{% endhint %}

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-MgwHuAY0sCdy2G8pSE1%2F-MgwL7y53I7yi2c--5J8%2FScreen%20Shot%202021-08-12%20at%206.46.45%20PM.png?alt=media\&token=de1d6d52-162a-444c-877f-5851b1257684)

**Step 2:** Once connected, GrowSurf will add/update your Marketo people every time a new participant is added or referred to your referral campaign.

**Step 3:** You should now see a screen that looks like the one below:

![](https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeklWo0yn03AhWro2Ux%2F-Mh-SsV0Rm-yuOABlwUb%2F-Mh-uW2auBzziMTUVcAr%2FScreen%20Shot%202021-08-13%20at%204.07.06%20PM.png?alt=media\&token=209fb5eb-f258-4229-8a48-8dae60654c4c)

## Examples

[View our Marketo tutorials](https://docs.growsurf.com/additional-integrations/marketo/tutorials) to see different kinds of examples that you can copy/paste into your email templates.

## **Custom Fields**

GrowSurf will automatically create these new custom fields for your Marketo people. <br>

| **Field Name**                               | **Data Token**                                      | **Field Type** | **Description**                                                                                                                                                                                            | **Example**                                                |
| -------------------------------------------- | --------------------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **GrowSurf Share URL**                       | `{{lead.GrowSurf Share URL}}`                       | Email          | The participant's unique referral link                                                                                                                                                                     | <https://growsurf.com?grsf=absc123>                        |
| **GrowSurf Participant ID**                  | `{{lead.GrowSurf Participant ID}}`                  | String         | The participant's unique GrowSurf ID                                                                                                                                                                       | abc123                                                     |
| **GrowSurf Referral Status**                 | `{{lead.GrowSurf Referral Status}}`                 | String         | The referral status of the participant\*                                                                                                                                                                   | `CREDIT_PENDING`                                           |
| **GrowSurf Participant First Name**          | `{{lead.GrowSurf First Name}}`                      | String         | The participant's first name                                                                                                                                                                               | Bob                                                        |
| **GrowSurf Participant Last Name**           | `{{lead.GrowSurf Participant Last Name}}`           | String         | The participant's last name                                                                                                                                                                                | Loblaw                                                     |
| **GrowSurf Referrer First Name**             | `{{lead.GrowSurf Referrer First Name}}`             | String         | The first name of the participant's referrer (if applicable)                                                                                                                                               | Gavin                                                      |
| **GrowSurf Referrer Last Name**              | `{{lead.GrowSurf Referrer Last Name}}`              | String         | The last name of the participant's referrer (if applicable)                                                                                                                                                | Belson                                                     |
| **GrowSurf Referrer Email**                  | `{{lead.GrowSurf Referrer Email}}`                  | Email          | The email address of the participant's referrer (if applicable)                                                                                                                                            | <gavin.belson@hoolie.io>                                   |
| **GrowSurf Total Referral Count**            | `{{lead.GrowSurf Total Referral Count}}`            | Integer        | The participant's all-time referral count                                                                                                                                                                  | 0                                                          |
| **GrowSurf Monthly Referral Count**          | `{{lead.GrowSurf Monthly Referral Count}}`          | Integer        | The participant's current month referral count                                                                                                                                                             | 19                                                         |
| **GrowSurf Previous Monthly Referral Count** | `{{lead.GrowSurf Previous Monthly Referral Count}}` | Integer        | The participant's previous month referral count                                                                                                                                                            | 200                                                        |
| **GrowSurf Next Milestone**                  | `{{lead.GrowSurf Next Milestone}}`                  | String         | The text for the next/upcoming milestone reward  (only applies to milestone rewards. [See an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone))         | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Next Monthly Milestone**          | `{{lead.GrowSurf Next Monthly Milestone}}`          | String         | The text for the next/upcoming monthly milestone reward  (only applies to milestone rewards. S[ee an example here](https://docs.growsurf.com/developer-tools/embeddable-elements#embedded-next-milestone)) | You are only 2 referrals away from winning a free t-shirt! |
| **GrowSurf Total Invite Count**              | `{{lead.GrowSurf Total Invite Count}}`              | Integer        | The participant's all-time invite count                                                                                                                                                                    | 112                                                        |
| **GrowSurf Total Impression Count**          | `{{lead.GrowSurf Total Impression Count}}`          | Integer        | The participant's all-time impression count                                                                                                                                                                | 150                                                        |

\**GrowSurf Referral Status* can be the following: `CREDIT_PENDING` (This participant must still trigger a referral for their referrer to receive referral credit), `CREDIT_AWARDED` (This participant triggered a referral and their referrer received referral credit), `CREDIT_EXPIRED` (This participant did not trigger the referral credit within the referral credit expiration window so their referrer did not receive referral credit).

You can use these merge tags in your Marketo email templates. Whether you launch a new marketing campaign or have an automated drip campaign going on, make sure to always include `{{lead.GrowSurf Share URL}}`in your emails to provoke your people to make referrals!

[Learn more about how to personalize Marketo emails here.](https://docs.marketo.com/display/public/DOCS/Personalize+an+Email)

## **Troubleshooting Tips**

* **If the new participant isn't being added to Marketo, or if they are being added but their unique referral link isn't being synced to Marketo:**
  * Activity logs will denote if a participant was added to Marketo or if they failed to be added. (In the case of failure, GrowSurf will re-attempt to add them for 7 days).
  * It is possible there could be an issue with your Marketo permissions when the new Marketo Custom Service was created with the *API Role*. Please disconnect the Marketo integration within GrowSurf, and follow the steps outlined in the *Important* section at the beginning of [this page](https://docs.growsurf.com/integrations/marketo#sync-with-marketo) to reconnect.
