SamCart

Configure the OptiPub SamCart Integration

📘

OptiPub Integrations

Integrations can be found in OptiPub > Administration > System Settings > Integrations


OptiPub SamCart Integration

Activate the SamCart Integration in OptiPub

To activate OptiPub's SamCart Integration you will need a SamCart API Key and Subdomain.

Gather Information from SamCart

API Key

Email [email protected] to request an API Key for your account. Review the SamCart API SamCart documentation for more information.

Subdomain

Login to your SamCart Account, and open Apps in the menu. Copy your subdomain from the URL (https://app.samcart.com/marketplace/{YOUR_SUBDOMAIN}/apps).

Example URL: https://app.samcart.com/marketplace/optipub/apps

Example Subomain: optipub


Configure OptiPub SamCart Integration

  1. Navigate to OptiPub > Administration > Integrations > SamCart and click Add +.
  2. Fill in your API Key and Subdomain.
  3. Toggle Enable SamCart on.
  4. Copy the Webhook URL that appears.
  5. Click Save.

Configure SamCart

Configure the Webhooks App

Review the Using Webhooks on SamCart SamCart documentation for more information.

Connect the OptiPub Webhook URL to SamCart

  1. Login to your SamCart Account, and open Apps in the menu.
  2. Explore Other apps, and click Install in the Webhooks card.
  3. Paste the OptiPub Webhook URL into the Notify Url text input.
  4. Click Connect.

If Webhooks are already installed, click Open App on the Webhooks card, then click the 3-dot Options menu in the top right and click Connect New App Instance.

Confirm Connection

Scroll down to the Logs section of the Webhooks App, and select Configuration logs.

An Integration successfully connected/refreshed. log should exist for the Connect App action. If no log is present, click Refresh Logs.

Add Global Rules to Webhook App

Add these Global Rules to the Webhooks App. Repeat for each trigger listed in the Triggers table below.

  1. Select Global in the Rules section.
  2. Click + Add New Rule
    1. Select the Global Rule rule type.
    2. Select the Send Notify Url POST action.
    3. Select a Trigger from the table below.
    4. Click Add Rule.
Triggers
Product Purchased
Product Refunded
Product Partially Refunded
Subscription Canceled
Subscription Started
Subscription Restarted

Configure SamCart Settings

Open SamCart Settings from the bottom of the main menu.

Add Custom Fields

Review the Custom Fields SamCart documentation for more information.

Open Custom Fields from the Settings menu.

Create a custom field named optipub_effort_id.

  1. Click New Custom Field
    1. Set Internal Field Name to optipub_effort_id.
    2. Set Checkout Page Label to OptiPub Effort ID.
    3. Set Field Type to Hidden Value.
    4. Click Save.

After saving, SamCart will automatically set a Slug name for the field.

Add OptiPub Tracking to SamCart Checkout Pages

Review the Pixels and Custom Conversion Tracking SamCart documentation for more information.

Open Tracking & Pixels from the Settings menu.

Paste the following into the Embed HTML/Scripts in Header then Save Changes.

<script src="https://assets.optipub.com/frontend/js/samcart-tracking.js"></script>

Maintaining the OptiPub SamCart Integration

Procedures in this section are required for all existing products, and new products added to SamCart.

Update SamCart Product Settings

📘

Products that Require Custom Field

SamCart Products require the optipub_effort_id custom field when the product uses SamCart Order Forms embedded in OptiPub Landing Pages.

Return to the main menu and open Products.

  1. Click the Name of a product.
    1. Scroll down in the Details view to the Checkout Controls section.
    2. Click inside Custom Fields so that a dropdown appears and select the optipub_effort_id custom field.
    3. Click Save Changes.
    4. Click Back to Product List.

Repeat for each product that will have an Order Page created in OptiPub Landing Pages.

OptiPub Order Pages will automatically insert the effort ID into the hidden optipub_effort_id field of the SamCart Order Form.

The SamCart Tracking & Pixels setting in the previous section must be configured with the embedded header script.

The effort ID inserted will allow OptiPub to integrate SamCart purchase event data with OptiPub Campaigns.


Map SamCart Products to OptiPub Publications

📘

All Products Require Publication Mapping

All Published SamCart Products must be mapped to a corresponding OptiPub Publication.

This mapping is required for OptiPub to accurately process subscription and product webhook events received from SamCart.

OptiPub syncs all Published, Test Mode, and Archived products.

  1. Navigate to OptiPub > Administration > Publications.
    1. Edit the Publication using the 3-dot action menu in the table.
    2. Continue to the Additional Information step.
    3. Click on SamCart Products in the SamCart Mapping section to display the products dropdown list.
    4. Select each SamCart Product belonging to the OptiPub Publication.
    5. Click Save.

Finding SamCart Products:

OptiPub

  • OptiPub displays the SamCart Product ID and Name.
  • The dropdown list is sorted by product ID.
  • Type a name or ID in the product area to filter the available products in the dropdown.

SamCart

  • Product search will work using the product ID displayed in OptiPub.
  • Use a consistent naming scheme to organize products.
  • Optional: Filter Products using Tags to review.