> For the complete documentation index, see [llms.txt](https://rudderlabs.gitbook.io/rudderlabs-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rudderlabs.gitbook.io/rudderlabs-1/docs/destinations/marketing/post-affiliate-pro.md).

# Post Affiliate Pro

Step-by-step guide to send your event data from RudderStack to Post Affiliate Pro.

[**Post Affiliate Pro**](https://www.postaffiliatepro.com/) is a popular affiliate marketing software that lets you manage your affiliate programs, track their performance, and boost your lead generation efforts.

RudderStack supports Post Affiliate Pro as a destination to which you can seamlessly send your customer data.

## Getting started

Before configuring Post Affiliate Pro as a destination in RudderStack, verify if the source platform is supported by Post Affiliate Pro by referring to the table below:

| Connection Mode | Web           | Mobile | Server |
| --------------- | ------------- | ------ | ------ |
| **Device mode** | **Supported** | -      | -      |
| **Cloud mode**  | -             | -      | -      |

To know more about the difference between cloud mode and device mode in RudderStack, refer to the [RudderStack connection modes](https://rudderstack.com/docs/rudderstack-cloud/rudderstack-connection-modes/) guide.

Once you have confirmed that your source platform supports sending events to Post Affiliate Pro, follow these steps:

* From your [**RudderStack dashboard**](https://app.rudderstack.com/), add the source. From the list of destinations, select **Post Affiliate Pro**.
* Assign a name to the destination and click on **Next**. You should then see the following screen:

![Post Affiliate Pro connection settings](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-3d60f5d6673d49d98870ae0abc2f137e5e45d897%2Fpap-connection-settings-1.png?alt=media) ![Post Affiliate Pro connection settings](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-28d9cd8468fb7cb9d0057bcd98213465165fdeb1%2Fpap-connection-settings-2.png?alt=media) ![Post Affiliate Pro connection settings](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-0ee8f0e2babd829c4cee9cc69957a935e7e7e011%2Fpap-connection-settings-3.png?alt=media)

### Connection settings

The connection settings required to configure Post Affiliate Pro as a destination in RudderStack are listed below:

* **URL of Post Affiliate Pro**: Enter your Post Affiliate Pro tracking URL here.

For more information on getting the Post Affiliate Pro URL, refer to the [FAQs](https://rudderstack.com/docs/destinations/marketing/post-affiliate-pro/#faqs) section below.

* **Account ID**: Enter your network merchant account ID here.

Post Affiliate Pro owners will have this value set to `default1`.

* **Param Name User ID**: If you have changed the **Affiliate ID / Referrer ID** parameter value by going to **Configuration** - **URL Parameter Names** in your Post Affiliate Pro dashboard, this new value should be entered here.
* **Cookie Domain**: Enter your cookie domain name here. You can find this setting by going to your Post Affiliate Pro dashboard and navigating to **Configuration** - **Cookies**, as shown:

![Post Affiliate Pro cookie domain setting](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-8c9f95bffb2a77034bf590f629778b00c24c2e7f%2Fpap-cookie-domain.png?alt=media)

* **Cookie to Custom Field**: Enter the ID of the field where the cookie will be written.
* **Campaign to Custom Field**: Enter the ID of the field where the campaign value will be written.
* **Affiliate to Custom Field**: Enter the ID of the field where the affiliate ID will be written.

#### Affiliate to Link settings

* **Affiliate Link ID**: Enter your affiliate link ID here, e.g. `affiliateId`. This refers to the ID of the DOM object where the Affiliate ID is added.
* **AffiliateId Parameter Name**: Enter your affiliate ID parameter name, e.g. `a_aid`.

Suppose you set the **Affiliate Link ID** to `affiliateId` and **AffiliateId Parameter Name** to `aff_id`. Then, the anchor link of the domain where you want to send the affiliate/referrer ID will be converted from: `<a href="http://abcd.com"id="affiliateId"></a>` to: `<a href="http://abcd.com/?aff_id=<the_affiliate_id>"id="affiliateId"></a>`.

#### Cookie to Link settings

* **Cookie Link ID**: Enter your cookie link ID here. This refers to the ID of the DOM object where the cookie ID is added.
* **Cookie Parameter Name**: Enter the cookie parameter name here.

These settings are similar to the **Affiliate to Link** settings, except that the cookie will be written in place of the `affiliateId`.

#### Event tracking settings

* **Merge Products**: This setting determines if RudderStack should merge the product information while making a sale call to Post Affiliate Pro. If disabled, an individual sale object will be created for each product.

Refer to the [Merging product information during sales tracking](https://rudderstack.com/docs/destinations/marketing/post-affiliate-pro/#sales-tracking) section for more information on this feature.

* **Disable Tracking Method**: Disable this setting to disable flash cookie creation.
* **List of Events for Click**: For [**Clicks Tracking**](https://rudder.postaffiliatepro.com/merchants/index.php#Clicks-Tracking), RudderStack will consider only the events listed in this field.

Make sure the event names specified in this field are comma-separated.

* As this is a destination that supports sending events only via the web device mode, the **Use device mode to send events** option will be always enabled.

Finally, click on **Next** to complete the setup. Post Affiliate Pro will now be enabled as a destination in RudderStack.

## Identify

You can use the RudderStack `identify` method to set a unique customer ID. You can then use this ID to subsequently track the customer's activities.

A sample `identify` call is shown below:

```javascript
rudderanalytics.identify(
  "user001", // visitor Id
);
```

RudderStack calls the `setVisitorId` function of the Post Affiliate Pro SDK and sets the user ID provided in the `identify` call, as shown:

```javascript
PostAffTracker.setVisitorId("user001");
```

## Track

RudderStack supports two types of event tracking for Post Affiliate Pro:

* **Clicks tracking**: RudderStack initiates Post Affiliate Pro's clicks tracking mechanism for the events that are explicitly specified in the **List of Events for Click** field, while setting up the integration.
* **Sales tracking**: RudderStack initiates Post Affiliate Pro's sales tracking only for the **Order Completed** event.

### Clicks tracking

A sample `track` event for clicks tracking is as shown:

```javascript
rudderanalytics.track(
"User Clicked", //event name
{
      affiliateId: "affiliate id",
      bannerId: "banner id",
      campaignId: "campaign id",
      channel: "channel",
      data1: "data1",
      data2: "data2",
} //properties
);
```

The **User Clicked** event must be explictly specified in the **List of Events for Click** field. Otherwise, the event will be discarded.

RudderStack maps the following properties to the Post Affiliate Pro click event properties:

| **RudderStack Event Property** | **Post Affiliate Pro Property** |
| ------------------------------ | ------------------------------- |
| `data1`                        | `Data1`                         |
| `data2`                        | `Data2`                         |
| `affiliateId`                  | `AffiliateID`                   |
| `bannerId`                     | `BannerID`                      |
| `campaignId`                   | `CampaignID`                    |
| `channel`                      | `Channel`                       |

### Sales tracking

In case of sales tracking, RudderStack creates a Post Affiliate Pro `sale` object. For the properties in the event, RudderStack then calls the respective `sale` object function.

A sample `Order Completed` event sent to Post Affiliate Pro sales tracking is shown below:

```javascript
rudderanalytics.track(
"Order Completed", //event name
{
      checkout_id: "12345",
      order_id: "1234",
      affiliation: "aff_id",
      total: 17.45,
      fixedCost: 20.5,
      revenue: 15.0,
      customCommision: 15,
      campaign: "campaignId",
      channel: "channelId",
      coupon: "ImagePro",
      currency: "EUR",
      status: "A",
      data1: "something",
      data2: "something",
      data3: "something",
      data4: "something",
      data5: "something",
      doNotDeleteCookies: true,

      products: [
        {
          product_id: "123",
          sku: "G-5",
          name: "Product1",
          price: 14,
          fixedCost: 20.5,
          quantity: 1,
          customCommision: 10.23,
          category: "Miscellaneous",
          currency: "USD",
          commisionStatus: "A",
          url: "https://www.website.com/product/path",
          image_url: "https://www.website.com/product/path.jpg",
        },
        {
          product_id: "345",
          sku: "F-5",
          name: "Product2",
          price: 2.45,
          fixedCost: 5.0,
          quantity: 2,
          customCommision: 10.50,
          commisionStatus: "A",
          category: "General",
        },
      ],
} //properties
);
```

When the **Merge Products** option is enabled while configuring the destination in the dashboard, RudderStack merges the product information and sends the `sale` object as seen in the Post Affiliate Pro dashboard below:

![Post Affiliate Pro sale object with combined product information](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-93a19f6b705bd8171da64f3ba5e2c0f88fa653a9%2Fpap-mergeproduct-true.png?alt=media)

If this option is disabled, two separate `sale` objects are created and sent to Post Affiliate Pro, as shown:

![Post Affiliate Pro separate sale objects](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-78e73fef61af227488cc49b9627e1117f2747678%2Fpap-mergeproduct-false.png?alt=media)

## FAQs

### Where do I get the Post Affiliate Pro URL?

To get your Post Affiliate Pro URL, follow these steps:

1. Log into your Post Affiliate Pro merchant website.
2. Then, click on **Tools** and go to **Integration**.
3. Under **Main Integration Steps**, choose any one of the **Clicks tracking** or **Sales/Leads Tracking** options.
4. Finally, copy the `src` part as shown below:

![Post Affiliate Pro tracking URL](https://876606571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq5Ea6fHVg3dSxMCgyQ%2Fuploads%2Fgit-blob-1539d486d1ebc988f64c19fab3c01205e3cc78e6%2Fpap-tracking-url.png?alt=media)

## Contact us

If you come across any issues while configuring or using Post Affiliate Pro with RudderStack, you can [**contact us**](mailto:%20docs@rudderstack.com) or start a conversation in our [**Slack**](https://rudderstack.com/join-rudderstack-slack-community) community.
