Custom script injection in MAZ Web app Custom script injection in MAZ Web app

Custom script injection in MAZ Web app

Vijay Sharma Vijay Sharma

Inject custom script in the header and footer of your MAZ web app to link tools like Facebook Pixel.

You can add custom script to the header or footer on MAZ Web app. For instance, you may want to add Facebook Pixel to track visitor activity on your MAZ Web which can be extremely useful if you are looking to measure the effectiveness of your ads, to define custom audiences for ad targeting, for dynamic ads campaigns, and to analyse the effectiveness of your website's conversion funnels.

NOTE: Any script that tries to change the UI of the app, for example showing a pop up for collection of user emails etc., might not work as expected due to the complex design elements of the Web app. This functionality if mainly designed for tools like Facebook Pixel.

How to add the scripts?

Step 1: Navigate to Content >> Channels >> Channel Setup and choose WEB from the drop down menu.

Step 2: In the WEB channel setup form, add the customer scripts to be placed in the header and footer of the WEB app, and save the form.



Important Note:

A complete script should be placed in the provided text fields (with appropriate starting and closing tags), in the channel setup form.


Example Facebook Pixel script:

<!-- Facebook Pixel Code -->
s.parentNode.insertBefore(t,s)}(window, document,'script',
fbq('init', '{your-pixel-id-goes-here}');
fbq('track', 'PageView');
<img height="1" width="1" style="display:none"
<!-- End Facebook Pixel Code -->


Where are the scripts added in the WEB app?

The script placed in the header text field, will be added before the closing head tag (</head>).

Screenshot 2021-09-14 at 2-38-45 PM-png.png

The script placed in the footer text field, will be added before the closing body tag (</body>).

Screenshot 2021-09-14 at 2-41-32 PM-png.png

Once the WEB channel setup form is saved, the changes will reflect in the live app within 5-10 minutes.


Know more about Facebook Pixel here.