Marketing Solutions Integration Guide


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=''></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 cid property to show Manage Settings on your button. Otherwise, the button shows Activate.

If you do not have a container ID, pass the onContainerCreate property and a function in your object's cid property. When the container is successfully created, your function is called with the container ID as the parameter.

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 149a2912-7235-11e7-b969-837adbf1d469.

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.
//Example styles object
const styles = {
button: {
color: 'red',
background: 'blue',
':hover': {
background: 'blue'
options.styles = styles

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 -->
;(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=''+s+d;f.parentNode.insertBefore(e,f);})(window,document,'script','paypalDDL','containerId');
<!-- PayPal END -->

Complete code example

This example shows a complete PayPal Marketing Solutions integration:

<div id='paypal-marketing-button-container'></div>

<script src=''></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: '',
    partner_name: 'bar',
    bn_code: 'xyz',
    env: 'sandbox',
    cid: 'Merchant ContainerId',


See the Marketing Solutions button parameters:

Install and activate PayPal Marketing Solutions for e-Commerce platforms: