On-Site SMS Collection

Getting set up with SMS for PostTap with on-site SMS collection and engagement.

📘

Launching Your Program

The following steps will not automatically begin SMS collection and can be safely added to your production environment.

After these steps are complete, you will work with your Button Partner Success Manager to launch your program via the PostTap dashboard.

Getting Started

Integration with SMS for PostTap requires just a few basic steps:

  1. Adding ButtonJS to every page on your website, with configurations set to allow SMS collection
  2. Reporting user conversions to Button
  3. Optionally, enabling automatic page-view event reporting to Button

Add or Update ButtonJS Library

If you haven't already integrated ButtonJS into your website's base HTML template, you'll need to do so by adding the code below either to the HTML of the website itself or as a custom HTML tag in your tag manager. Please note that if you do so via a tag manager, you will need to set the tag's trigger to fire on all pages.

<script>
  window.ButtonWebConfig = {
    // Replace app-xxxxxxxxxxxxxxxx with your Mobile Web App ID from
    // the Button Dashboard: https://app.usebutton.com
    applicationId: 'app-xxxxxxxxxxxxxxxx',
    // The following property is required
    enableSmsCollection: true
  };

  (function(u,s,e,b,t,n){u['__bttnio']=b;u[b]=u[b]||function(){(u[b].q=u[b].q||[]).push(arguments)};t=s.createElement(e);n=s.getElementsByTagName(e)[0];t.async=1;t.src='https://web.btncdn.com/v1/button.js';n.parentNode.insertBefore(t,n)
                        })(window, document, 'script', 'bttnio');
</script>

If you have already integrated the ButtonJS library on your website, you will still need to update the ButtonWebConfig object with one new field:

enableSmsCollection: true

Once complete, your ButtonWebConfig object should look like so:

window.ButtonWebConfig = {
    applicationId: 'app-xxxxxxxxxxxxxxxx', // should already be populated with your Button Mobile Web App ID
    enableSmsCollection: true // new field
  };

Once this is complete, the rest of the setup and configuration for the on-site SMS collection widget takes place in your Button Dashboard under the Collection tab.


Reporting Conversions

Reporting user conversions to Button unlocks advanced campaigning tools and allows you to measure the value of your program. The bttnio library, added above, includes a separate method to construct the required payload for client-side order reporting.

📘

Reporting Conversions

Read implementation details in our Mobile Web Order Reporting doc.

Continue

Reporting Pageviews

You can choose to report pageview events to Button via our library, which will allow you to target users that enroll in your SMS program by the types of products they interact with on your site.

To do so, set enableAutomaticActivityReporting: true in your ButtonWebConfig, like so:

 window.ButtonWebConfig = {
    applicationId: 'app-xxxxxxxxxxxxxxxx', // should already be populated with your Button Mobile Web App ID
    enableSmsCollection: true,
    enableAutomaticActivityReporting: true // new field
  };

Note that this option only reports pageviews for users that have enrolled in your SMS program — it does not send pageview events to Button for all users of your site.

Manual product category reporting

If you'd like to pass category information for product views to Button manually, rather than by having Button automatically categorize the products your users view, you can do so by calling reportProductView:

bttnio('reportProductView', {
  categories: ['yourcategory1', 'yourcategory2']
});

This is an alternative to setting enableAutomaticActivityReporting: true, you do not need to implement both. Like the automatic option above, this method will only report product views for users that have enrolled in your SMS program.


What’s Next

Continue on to set up client-side order reporting to Button.

Did this page help you?