# Meta (Facebook) Ads

## How It Works <a href="#sync-with-your-activecampaign-list" id="sync-with-your-activecampaign-list"></a>

The Meta Ads integration lets you retarget website visitors who arrive through referral links and track their conversions. Once connected, Meta Ads will track these referred visitors and conversions when they submit their email addresses on your website.

{% hint style="success" %}
Under the hood, GrowSurf loads the Meta Ads library (Facebook script) for event tracking. If Meta Ads is already installed, GrowSurf intelligently avoids loading it twice.
{% endhint %}

***

## How to Set Up

**Step 1**: In *Campaign Editor > 4. Options > Integrations*, open the Meta Ads integration card and enter your [Meta Ads pixel ID](https://www.facebook.com/business/help/171689010314963).

{% hint style="info" %}
**Note:** If you are 100% certain that you already have Meta Ads (as a Facebook pixel) installed on your website, you do not need to enter in the Meta Ads pixel ID. Simply press *Connect* and the integration will be enabled. However, we recommend that you still enter it to account for URLs that do not have Meta Ads installed.
{% endhint %}

<figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2F0nO8lHjAJX5v6cLkIBOj%2Fimage.png?alt=media&#x26;token=69f35046-79a9-40b9-bd28-d054b1928e6f" alt=""><figcaption></figcaption></figure>

**Step 2:** Once connected, GrowSurf will have all events enabled by default. Disable any events that you do not want to track.

{% hint style="danger" %}
**Important Note**: Make sure that your campaign Share URL (found in the *Campaign Editor > 5. Installation* step) is a part of your Meta Ads account. If you are using multiple domains, within Meta Ads manager, you may need to enable **Automatic Advanced Matching** and set up **Domain Verification** to avoid issues with shared traffic between domains.
{% endhint %}

**Step 3:** In your Meta Ads account, you will need to add the following two custom conversions (You can skip this step if you have both "Track conversion event" checkboxes toggled off). Follow the instructions in [How to Add Custom Conversions In Meta Ads](#how-to-add-custom-conversions-in-meta-a-ds).

* `growsurf_referral_signup` - This conversion event represents when a referred visitor submits their email address on the form on your website that has referral tracking on it.
* `growsurf_referral_trigger` - This conversion event represents when a participant completes a qualifying action, like making a purchase (Note: this only applies when you are using [`growsurf.triggerReferral()`](https://docs.growsurf.com/developer-tools/javascript-sdk/api-reference#trigger-referral)from the front-end).

***

## How to Add Custom Conversions In Meta Ads

<details>

<summary>Open instructions</summary>

You'll need to complete steps 1-11 below for each event `growsurf_referral_signup` and `growsurf_referral_trigger`.

1. Log into your [Meta Ads Manager account](https://adsmanager.facebook.com/adsmanager).
2. From the left-side menu, navigate to *All tools > Advertise > Events Manager* (see image below)*.*

   <figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FdHOwSgMElqZTQF151F52%2Fimage.png?alt=media&#x26;token=fdeaf2b8-cd25-49f5-b83f-3fb4b6ae17ba" alt=""><figcaption></figcaption></figure>
3. Choose the pixel ID that you entered for the Meta Ads integration within GrowSurf (see image below).

   <figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FSiGHnC1MnzaoxQHKYwe2%2Fimage.png?alt=media&#x26;token=0a96a334-9346-45f2-9581-b33a1bbf7dfa" alt=""><figcaption></figcaption></figure>
4. You should now be seeing a page called "Data Sources". Click the top-right *Create* button and choose "Create custom conversion" from the dropdown (see image below).

   <figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FhclyEDK7uJdAKoHawxA8%2Fimage.png?alt=media&#x26;token=75a813e8-a8ad-4f23-8276-9ecb1451dd6c" alt=""><figcaption></figcaption></figure>
5. You should be seeing a popup window with the title "Create a custom conversion". For the Name field, enter enter the following conversion name depending on which conversion event you're adding:
   1. `growsurf_referral_signup`&#x20;
   2. `growsurf_referral_trigger`
6. For the Data source field, make sure to keep the same pixel ID you chose from step 1 selected.
7. For the Action Source field, keep "Website" selected.
8. For the Event field, choose one of the following:
   1. For `growsurf_referral_signup`, we recommend using "Lead" (or choose a different category that best represents a referred visitor signing up).
   2. For `growsurf_referral_trigger`, we recommend using "Add payment info" (or choose a different category that best represents when a referred participant completes a qualifying action, which triggers a referral).
9. In the first Rules dropdown, select "Event Parameters". Then in the second Rules field, type in `source`. For the third Rules field, select "equals". Then in the fourth Rules field, enter `growsurf`. Your screen should now look like the image below:

   <figure><img src="https://2794996218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LeklWo0yn03AhWro2Ux%2Fuploads%2FZtHhPm8MUw26TPQg0Zv4%2Fimage.png?alt=media&#x26;token=af87f766-493c-4fb8-96c5-62f301422f35" alt=""><figcaption></figcaption></figure>
10. For the other fields like Description and Conversion value, you can adjust to your preferences.
11. Click the *Create* button.
12. Make sure that you repeat steps 1-11 above for `growsurf_referral_trigger` as well.

</details>

***

## **Troubleshooting Tips** <a href="#troubleshooting-tips" id="troubleshooting-tips"></a>

Here are common scenarios and how to troubleshoot them.

#### If Meta Ads events are NOT occurring, but you were expecting them:

* Make sure you do not have any ad-blockers or browser extensions blocking requests to Meta Ads.
* Make sure your campaign Share URL (and the page where the referral submits their email address, if you are tracking conversions) is a part of your Meta Ads account. You can find the campaign Share URL in the *Campaign Editor > 5. Installation* step. In your Meta Ads account, you may need to enable **Automatic Advanced Matching** and set up **Domain Verification** to avoid issues with shared traffic between domains.
* If you are testing conversions being tracked, make sure that you've allowed up to 30 minutes for Meta Ads to process the events.
* To troubleshoot if the Meta (Facebook) ads script is loading on your website, you'll want to make sure you that you visit a participant's referral link first.

#### If Meta Ad events are occurring, but you were NOT expecting them:

* If you want to prevent Meta Ads from being loaded completely, you must disconnect the integration completely. Simply toggling off all checkboxes is insufficient.
* If you see Meta Ads network requests being made on your website and you have the integration completely disabled, GrowSurf may not be emitting these events. Check other parts of your code to find where these events might be happening.
