How to add custom scripts with “Custom Scripts” module

Home » Support » Docs » How to add custom scripts with “Custom Scripts” module

We strongly recommend that you add scripts for diffrerent tools in separate sections.

You can integrate 3rd party tracking tools using “Custom Scripts” module.

Scripts can be added to either a <head> or right before the closing </body> tag (see sections in the left menu).

image 4

Each tab contains sections that allow you to add your custom scripts.

adding custom scripts animation

Fields available in the sections for adding scripts can differ depending on the modules you enable.

The common ones are:

  1. Display name – this is where you give the script a name. This name is displayed by a [fp_info] shortcode which you can put in your privacy policy. (A reminder: this shortcode outputs a list of all the tracking tools you enabled in FP).
  2. Script id – the ID here is auto-generated but you can change it to whatever you want. Script ID is used in fpdata object.
  3. Script field – this is where you enter your modified script.
  4. Validation mode – enable this option if you need to validate the installation of your script. Remember to disable it afterwards. If you don’t do that your script will be triggered on every page load without exception (even for excluded users and administrators).

Script modifications

Some scripts you enter need to be modified by Full Picture. The modification is required. Without it Full Picture wouldn’t be able to conditionally enable/disable your script for specific users and locations.

From version 4.1 the modification is done automatically.

When you copy-paste scripts to Full Picture you may notice that the <script> tags are removed or changed into FP.getScript() function.

For example this line:

<script src="https://example.com/script.js" async id="some_script"></script>

will turn into this:

FP.getScript( 'https://example.com/script.js', false, { 'async' : true, 'id' : 'some_script' } );

If you are on a version lower than 4.1 you need to make the change yourself according to this “recipe”:

FP.getScript( 'your script URL', false, { 'parameter name' : 'parameter value' } );

If the change didn’t happen automatically, please check your script. It may contain an error in the <script [some attributes]> line.

Adding variables and custom data to scripts

In addition to installing scripts on your page, Full Picture also lets you extend them with information like page titles, user role, visitors country, time on page, etc.

Please read this article for more information.