Marketing Solutions Integration Guide
SDKLegacyLast updated: June 9th 2022, @ 2:48:51 pm
Important: PayPal Marketing Solutions is a legacy product. We accept new integrations and support existing integrations, but there are new solutions.
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.
`<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:
MUSEButton('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. <script> |
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.
<!-- PayPal BEGIN -->
<script>
;(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');
</script>
<!-- PayPal END -->
Complete code example
This example shows a complete PayPal Marketing Solutions integration:
<div id='paypal-marketing-button-container'></div>
<script src='https://www.paypalobjects.com/muse/partners/muse-button-bundle.js'></script>
<script>
MUSEButton('paypal-marketing-button-container', {
onContainerCreate: (containerId) => {
// Optional callback. If cid property is not passed in,
// A container ID will be created for you.
},
host_name: 'https://example.com',
partner_name: 'bar',
bn_code: 'xyz',
env: 'sandbox',
cid: 'Merchant ContainerId',
})
</script>
Next
See the Marketing Solutions button parameters:
Install and activate PayPal Marketing Solutions for e-Commerce platforms: