Script Library - reuse your code in multiple pages

 This feature is available for ‘Plus’ users and above.

Notice - All the instructions listed below for JavaScript codes also apply to CSS Styles.

About the ‘Script Library’

With Pagewiz you can add JavaScript and CSS codes to each page separately. This option is available on all plans. But if you want to use the same script on multiple pages you will have to copy the same script over and over again for each page. The Script Library solves this problem by allowing you add the script once and then pull it whenever you need it again.

A common use case for this feature is when a campaign manager adds a conversion code. With the new Script Library the manager can use it later on other pages or ask the designer to pull it without testing it again, knowing it already works properly on other pages.
Here’s how it works:

Add new scripts

To add a new script to the Script Library, open a page in Design mode and click on:
‘Page Settings’ > ‘Scripts & Styles’ > ‘JS’

how_to_get_there.png


Press the ‘+ Add new’ button, add your script, check the ‘Add to script library’ checkbox and click ‘Apply’.

 scripts_screen.png

add_script.png

By checking the ‘Add to script library’ checkbox the script will be added to the main Script Library so you can use it later in other landing pages.

 

Reuse an existing library script

Enter a page in Design mode and click on ‘Page Settings’ > ‘Scripts & Styles’ > ‘JS’. Click the down arrow on the ‘+ Add new’ button, and click ‘Add from library’.

add_from_library.png

You’ll see all the library scripts that are not yet linked to this page. Click the ‘Add’ button to pull an existing script into the current page.
add.png

 

Removing a library script from a page:

Navigate to the JavaScript window as explained above. Click the ‘Actions’ drop down and then select the ‘Remove’ option. This action removes the script from the current landing page you’re working on. Note that this script won’t be deleted from the Script Library or from other pages it is linked to (for that, you will have to delete it from the Script Library itself).

remove.png

Edit a library script

Navigate to the JavaScript window as explained above. Click the ‘Actions’ drop down and select the ‘Edit’ option. Edit the code and click Save.
Note that changing a library script’s code will affect all the landing pages that are linked to it.

 edit.png

Tip: You can always edit your library scripts, even when they’re not embedded in the page you’re currently working on.  Just click ‘Script Library’, select your desired page, then click ‘Actions’ and select ‘Edit code’.
Note that changing a library script’s code will affect all the landing pages that are linked to it.

edit_code.png

Delete a library script permanently:

Navigate to the JavaScript window as explained above and click ‘Script Library’. Click ‘Actions’ and select ‘Delete’. Click ‘Delete’ again in the confirmation window and your script has been removed.  

Note that a library script that is deleted permanently cannot be restored. Your deleted script will also be removed from all landing pages that are linked to it.

 delete.png

 

To see all library scripts saved under your Pagewiz account:

Open the JavaScript window as explained above and click ‘Script Library’. Each Script in the list has 4 options:

  1. 'Add to page' (or 'already in use').
  2. Edit a ‘Library script’. Note that editing a script will affect all the landing pages linked to it.
  3. Delete a ‘Library script’ permanently from all pages linked to it.
  4. See which landing pages are linked to a particular library script.
Have more questions? Submit a request

0 Comments

Article is closed for comments.