Marketing Solutions Integration Guide
Last updated: Sept 10th, 6:55pm
PayPal Marketing Solutions uses a Tag Manager to manage marketing products for merchants. A Tag Manager requires a container, which is comprised of a set of macros, rules, and tags.
Take these steps to integrate PayPal Marketing Solutions.
1. Add the JavaScript to your site
In the main HTML file of the merchant site, add the PayPal JavaScript tag.
1<script src='https://www.paypalobjects.com/muse/partners/muse-button-bundle.js'></script>
2. Create PayPal Marketing Solutions Button
After the script loads, place the button in the
'insert-element-id'
element of this function:
1MUSEButton('insert-element-id', {...})
Pass one of these properties in the {...}
parameter to configure
the button:
Property | Description |
---|---|
Container ID (cid ) |
If you have a container ID, place it in your object's
If you do not have a container ID, pass the
Your callback function must save the container ID so you can access it the next time the merchant is identified. Otherwise, a container is created for the merchant.
For example, a container ID might be
|
Styles (styles ) |
The styles object uses the button key to
stylize the button. Apply CSS properties in camel case to change the
button style:
style: [{"key1": "value1"}, {"button": "CSSvalueInCamelCase"}]
For pseudo-classes such as :hover , the key value type is
object.
|
3. Add the container ID to the merchant site
To complete the integration, add this script tag in the merchant site header.
You must replace containerId
with the actual
container ID.
1<!-- PayPal BEGIN -->2<script>3;(function(a,t,o,m,s){a[m]=a[m]||[];a[m].push({t:new Date().getTime(),event:'snippetRun'});var f=t.getElementsByTagName(o)[0],e=t.createElement(o),d=m!=='paypalDDL'?'&m='+m:'';e.async=!0;e.src='https://www.paypal.com/tagmanager/pptm.js?id='+s+d;f.parentNode.insertBefore(e,f);})(window,document,'script','paypalDDL','containerId');4</script>5<!-- PayPal END -->
Complete code example
This example shows a complete PayPal Marketing Solutions integration:
1<div id='paypal-marketing-button-container'></div>23<script src='https://www.paypalobjects.com/muse/partners/muse-button-bundle.js'></script>4<script>5 MUSEButton('paypal-marketing-button-container', {6 onContainerCreate: (containerId) => {7 // Optional callback. If cid property is not passed in,8 // A container ID will be created for you.9 },10 host_name: 'https://example.com',11 partner_name: 'bar',12 bn_code: 'xyz',13 env: 'sandbox',14 cid: 'Merchant ContainerId',15 })16</script>
Next
See the Marketing Solutions button parameters:
Install and activate PayPal Marketing Solutions for e-Commerce platforms: