> For the complete documentation index, see [llms.txt](https://docs.growsurf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.growsurf.com/integrations/embeddables.md).

# Embeddables

Add referral tracking to your Embeddables flow to automatically recognize new leads that come through referrals.

{% hint style="info" %}
**Requirement to make Embeddables work with GrowSurf**:

* The GrowSurf Universal Code must be installed on the webpage where your Embeddable is published.
  {% endhint %}

## Prep Your Flow <a href="#prep-your-flow" id="prep-your-flow"></a>

If you have an Embeddables flow published on your website that you want to add referral tracking to, follow these instructions:‌

**Step 1:** Open the GrowSurf Program Editor and navigate to the *Installation* tab.‌

**Step 2:** Continue through the installation steps until you reach the step that asks how GrowSurf will know a referred friend signed up.​‌

**Step 3:** Click the Embeddables icon and follow the instructions GrowSurf shows. You will copy a block of JavaScript and paste it into an Embeddables Action.‌

**Step 4:** Then finish the remaining installation steps.‌

## How It Works <a href="#how-it-works" id="how-it-works"></a>

An Embeddable renders inline on your own page rather than in an iframe, and an Embeddables Action runs in that same page. So the Action can read the respondent's User Data and call GrowSurf directly.

In Embeddables, open the Logic card, go to *Triggers*, and add a trigger for the moment you have the respondent's email address, typically a click on the button that submits it. Create an Action on that trigger and paste in the code from the GrowSurf Program Editor. Then click *Save*, open the Version Control card, select that version, and click *Production*.

For each field, the Action uses the first matching User Data key in this order:

* Email address: `email`, `email_address`, or `emailAddress`, otherwise the one answer that is itself an email address (if several answers are, nothing is sent)
* First name: `first_name`, `firstName`, or the first word of `full_name` / `fullName` / `name`
* Last name: `last_name`, `lastName`, or the second word of `full_name` / `fullName` / `name`

An answer that is not text (a multi-select, a file) is skipped rather than stored as someone's name. If no email address is found, nothing is sent and no participant is added.

## Additional Tips <a href="#additional-tips" id="additional-tips"></a>

* Pick a trigger that fires once the email address has actually been entered. A trigger on flow load runs before the respondent has typed anything, so nothing is sent to GrowSurf.
* While following the instructions GrowSurf shows, you may skip any steps that you have already completed from previous setup in Embeddables.
* If you run into issues or have any questions, please reach out to [GrowSurf support](https://support.growsurf.com/) for assistance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.growsurf.com/integrations/embeddables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
