Support

Google Tag Manager (GTM)

Load script with Google Tag Manager (GTM)


Preconditions

GTM was already configured and added to the targeting website.




Steps

  1. Login into Google Tag Manager.
  2. Go to the Template section as shown in the image below and create a new Tag Template.


In the info section, fill out the form.
You can give the template any name you like.




  1. Go to the Code section.



Enter the following code and adjust it, based on what you need to do.


// Enter your template code here.
const log = require('logToConsole');
const injectScript = require('injectScript');

injectScript("https://cdn.scalapay.com/widget/scalapay-widget-loader.js", () => {

  log("sucess");

  data.gtmOnSuccess();
  
}, () => {
log("error loading.");
  data.gtmOnFailure();
  
});

  1. Switch to the permission tab and addhttps://*.scalapay.com/in the Injects scripts field.


  1. Click on Save.

Now you can use this Tag Template anywhere you want.

Here's an example.



Continue with the normal flow of integrating the widget (part two of widget installation).