How to Add a PRE / POST SCRIPT TAG to your Player

What are Pre/Post Script Tags?

The Pre/post Script area in the player allows you to add custom JavaScript code to the Player Tag embed code directly from the Portal. When included, your custom script will be part of the Player Tag embed code. You can choose to either add the script before or after the Player request script tag.

This feature is extremely useful when adding custom tracking pixels or custom functionalities, outside the player, that can be easily embedded with the same Player tag embed code.

 

 

Add or Change a Script Tag

To add a Script Tag to your Player tag embed code, perform the following steps:

  1. Access the player wizard by editing an existing player or creating a new one.

    Access_EMBED_TAG_Tab.jpeg

  2. Click on 'ADVANCED' and select the 'EMBED TAG' tab.

    NUI_Player_Script_1202_.jpeg

  3. Under the 'EMBED TAG' tab, go to the 'PRE/POST SCRIPT TAG' area and apply the required field according to the following table:

    Field Name Descroiption
    SCRIPT LOCATION

    Click on this field and select where in the Player Tag embed code your custom script will be located according to the following options:

    • Before embed tag - Selecting this option will embed the JavaScript tag within the Player tag <div> element, but before the player delivery request <script> tag.
    • After embed tag - Selecting this option will embed the JavaScript tag within the Player tag <div> element, but after the player delivery request <script> tag.
    SCRIPT

    Enter your custom JavaScript code in this field. 

    Note: You do not need to add any HTML <script> tags at the beginning or end of your custom code, as they will be added automatically.



  4. Optional: Repeat steps 3-4 to add additional JavaScript tags to your Player tag embed code.

  5. Click on 'Add script'. You custom script is added to the player tag embed code.

  6. Click on 'SAVE'. You custom script is saved to the player.
Have more questions? Submit a request