All Collections
Multi-Platform Subscription App (Not for Shopify)
Apps & Integrations
How to install 3rd party scripts for conversion, tracking & customization
How to install 3rd party scripts for conversion, tracking & customization

The custom scripts app on PayWhirl lets you include 3rd party scripts on your widgets, payment forms and/or customer portal pages.

Larry Brager avatar
Written by Larry Brager
Updated over a week ago

The custom scripts app on PayWhirl has MANY uses. It can be used to CUSTOMIZE any of the pages PayWhirl provides, from widgets, to the cart & checkout flow, to the customer portal, and much more. 

The app also allows you to include 3rd party CONVERSION or TRACKING scripts on widgets, payment forms or after completed checkouts.

POPULAR USES FOR THE CUSTOM SCRIPTS APP

  • Conversion Tracking

  • Affiliate Tracking

  • Customizing PayWhirl

To install the custom tracking scripts integration click Apps & Integration in the Main Menu of your account and then click "Install App" next to Custom Tracking Scripts app:

NOTE: If you have multiple tracking scripts, you can install as many custom script apps as you need, or add multiple scripts to a single app.

Once you have installed the app successfully you will see two different tabs on the settings page. One section will load scripts on EVERY PAGE PayWhirl provides and the other section will only load scripts AFTER CONVERSIONS, when people complete checkout successfully. 

Typically the service you are using for tracking will provide a snippet of code that needs to get run on "Every Page" or just after "Conversions". Make sure to paste the code in the correct tab, including <script> tags. 

PayWhirl also provide variables (information from your customers & checkout data) to help you customize your tracking scripts and/or inject data into scripts as needed.

You can use any of the following variables to inject customer data into the tracking scripts: 

Customer Tracking Variables                            
----------------------------------------------------------------------
{{ customer.id }} Customer ID
{{ customer.first_name }} First name
{{ customer.last_name }} Last name
{{ customer.email }} Email
{{ customer.phone }} Phone
{{ customer.address }} Street Address
{{ customer.city }} City
{{ customer.state }} State/Province
{{ customer.zip }} Zip/Postal Code
{{ customer.country }} Country Code
{{ customer.utm_source }} Acquisition Source
{{ customer.utm_medium }} Acquisition Medium
{{ customer.utm_term }} Acquisition Keyword/Search Term
{{ customer.utm_content }} Acquisition Ad Content
{{ customer.utm_campaign }} Acquisition Ad Campaign
{{ customer.utm_group }} Acquisition Ad Group


On the CONVERSION tracking side (after checkout) there are additional variables:

Conversion Tracking Variables
----------------------------------------------------------------------
{{ invoice.id }} Invoice ID
{{ invoice.paid }} Invoice Paid Status (0 or 1)
{{ invoice.subtotal }} Invoice Subtotal
{{ invoice.shipping_total }} Invoice Shipping Costs
{{ invoice.tax_total }} Invoice Tax Costs
{{ invoice.amount_due }} Invoice Grand Total
{{ invoice.promo_code }} Invoice Promo Code (if used)
{{ invoice.items[X].description }} Invoice Item Description
{{ invoice.items[X].quantity }} Invoice Item Quantity
{{ invoice.items[X].amount }} Invoice Item Amount
{{ invoice.items[X].currency }} Invoice Item Currency
{{ invoice.items[X].sku }}        Invoice Item SKU

{{ address.address }} Invoice Shipping Address
{{ address.city }} Invoice Shipping City
{{ address.state }} Invoice Shipping State
{{ address.zip }} Invoice Shipping Zip/Postal code
{{ address.country }} Invoice Shipping Country
{{ address.phone }} Invoice Shipping Phone Number

{{ subscription.customer_id }} Customer ID
{{ subscription.plan_id }} Plan ID
{{ subscription.quantity }} Subscription Quantity
{{ subscription.current_period_start }} Current Subscription Period Start Date
{{ subscription.current_period_end }}   Current Subscription Period End Date
{{ subscription.trial_start }}        Trial Start Date
{{ subscription.trial_end }} Trial End Date
{{ subscription.installment_plan }} Subscription is an Installment Plan
{{ subscription.installments_left }}    Subscription Installments Left

{{ plan.name }}        Plan name
{{ plan.setup_fee }}        Plan Setup Fee
{{ plan.installments }} Plan Number of Installments
{{ plan.require_shipping }} Plan Require Shipping
{{ plan.require_tax }} Plan Require Tax
{{ plan.active }} Plan Active
{{ plan.image }} Plan Image
{{ plan.description }} Plan Description
{{ plan.billing_amount }} Plan Billing Amount
{{ plan.billing_interval }} Plan Billing Interval
{{ plan.billing_frequency }} Plan Billing Frequency
{{ plan.trial_days }} Plan Trial Days
{{ plan.sku }} Plan SKU
{{ plan.currency }} Plan Currency
{{ plan.billing_cycle_anchor }} Plan Billing Cycle Anchor
{{ plan.file }} Plan File
{{ plan.autorenew_plan }} Plan Auto-renew To
{{ plan.tags }} Plan Tags
{{ plan.enabled }} Plan Enabled


You can also use LOGIC inside of the custom scripts app to help you loop through data from a transaction (for example):

{% for item in invoiceitems %}
     
         trackItem({    
                'sku': '{{ item.sku }}',    
                'quantity': '{{ item.quantity }}',    
                'price': '{{ item.amount }}'
         });

{% endfor %}


You can also use jQuery to customize, animate and/or style pages within PayWhirl as needed... Finally, after loading conversion or tracking scripts you can optionally forward customers to a specific thank you page if you'd rather not direct customers to your customer portal after a purchase.

NOTE: If you are not familiar with how to edit the code to include the variables we provide, you may need the help of a developer to get scripts working correctly. 

Related Articles:

Please let us know if you have any questions.

Sincerely,
The PayWhirl Team

Did this answer your question?