SAREpush
  • INTRODUCTION
  • Platform Support
  • JAVASCRIPT LIBRARY
    • Installing library on website
    • Installing library through GTM
    • Tagging a subscriber using library
    • Preview subscriber's tags in our platform.
    • Sending shopping cart events using library
  • REST API
    • Introduction
    • Retrieving a list of websites
    • Retrieving JS code for specific website
    • Creating campaign to all subscribers
    • Creating campaign to particular locations
    • Creating campaign to particular tags
    • Creating campaign to particular segments
    • Sending message to specific subscriber
    • Sending message to test subscribers
    • Retrieving a list of segments
    • Retrieving a list of locations
    • Retrieving a list of tags
    • Retrieving a list of subscribers
  • PLUGINS
    • Installing WordPress plugin
  • CAMPAIGNS
    • Delivery automation
      • Welcome notification
      • When leave website
      • When visit specific web page
      • When spend X time on specific web page
    • Delivery to audience
      • Send to all subscribers
      • Send to particular segments
      • Send to particular tags
      • Send to test segment
    • Delivery scheduling
      • Send at a particular time
      • Sent recurring
    • Message personalization
    • Message preview
    • Message time to live
    • Images and icons
  • User management
    • User Management
    • Permission table
  • Product feed
    • What is XML Product Feed?
Powered by GitBook
On this page
  1. JAVASCRIPT LIBRARY

Installing library through GTM

PreviousInstalling library on websiteNextTagging a subscriber using library

Last updated 4 years ago

GTM allows you to easily add different kind of services, javascript codes or just custom HTML to your website.

  1. Register your GTM account if you did not do that yet.

  2. Create new tag.

  3. Choose tag type, and select Custom HTML.

  4. Paste in the JavaScript library.

<script>
    !function(e,n,s,t,o){e.sarepush=e.sarepush||function(){(e.sarepush.q=e.sarepush.q||[]).push(arguments)},
    t=n.createElement('script'),o=n.getElementsByTagName('script')[0],
    t.async=1,t.src='//push-cdn.s3-eu-west-1.amazonaws.com/<account-id>/<your-website-uid>/library.min.js',
    o.parentNode.insertBefore(t,o)}(window,document);
</script>

Remember that each website has a slightly different code. The difference is website unique identifier in the link to the library.

After the code is inserted, you have to add Service Worker file to the root folder of your website. To do so, go to website management in our platform and download the following zip by click on Download Service Worker.

Finally unpack zip and upload sarepush-worker.js file to the top-level root of your website. Depending on how your website is hosted, you may need to contact administrator or developer to help you copy this file to your website.

If you are integrating SAREpush into a site with an existing service worker (like a PWA), you may have to merge service workers.

Directly from website management in our platform you can send a email message to your programmer with the manual by click on Send to developer.