SamCart
Configure the OptiPub SamCart Integration
OptiPub Integrations
Integrations can be found in OptiPub > Administration > System Settings > Integrations

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
- Navigate to
OptiPub > Administration > Integrations > SamCart
and click Add +. - Fill in your
API Key
andSubdomain
. - Toggle
Enable SamCart
on. - Copy the
Webhook URL
that appears. - 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
- Login to your
SamCart Account
, and openApps
in the menu. - Explore
Other
apps, and click Install in theWebhooks
card. - Paste the OptiPub
Webhook URL
into theNotify Url
text input. - 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.
- Select
Global
in theRules
section. - Click + Add New Rule
- Select the Global Rule rule type.
- Select the Send Notify Url POST action.
- Select a
Trigger
from the table below. - 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
.
- Click New Custom Field
- Set
Internal Field Name
tooptipub_effort_id
. - Set
Checkout Page Label
toOptiPub Effort ID
. - Set
Field Type
toHidden Value
. - Click Save.
- Set
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 usesSamCart Order Forms
embedded in OptiPub Landing Pages.
Return to the main menu and open Products
.
- Click the
Name
of a product.- Scroll down in the
Details
view to theCheckout Controls
section. - Click inside
Custom Fields
so that a dropdown appears and select theoptipub_effort_id
custom field. - Click Save Changes.
- Click Back to Product List.
- Scroll down in the
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 theSamCart 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
, andArchived
products.
- Navigate to
OptiPub > Administration > Publications
.- Edit the
Publication
using the 3-dot action menu in the table. - Continue to the
Additional Information
step. - Click on
SamCart Products
in theSamCart Mapping
section to display the products dropdown list. - Select each
SamCart Product
belonging to theOptiPub Publication
. - Click Save.
- Edit the
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.
Updated 5 days ago