Integrate Dotdigital with Joomla

Add scripts to your Joomla site to power a range of Dotdigital features.

Laura Russell avatar
Written by Laura Russell
Updated over a week ago

There are a number of Dotdigital scripts you can add to your site through your Content Management System (CMS), which allow you to collect and transfer data, and trigger certain actions, across both systems.

Learn more about the available scripts in Integrate Dotdigital with your CMS.


The most straightforward way to add custom JavaScript to your Joomla site is to use a plugin which allows you to add custom script, either to your whole site, or to individual articles.


Add scripts to your entire Joomla site

1. Create your .js file

  1. Log in to your Joomla admin portal.

  2. Go to System > Site Templates and select the template name you want to edit.

  3. Select New File.

  4. Select the js folder from the left side menu, enter a File Name, and expand the File Type drop-down menu and select .js.

  5. Select Create.

  6. In the File Editor, paste in your script or code snippet.
    Do not include any <script> tags, as the plugin adds these automatically.

  7. Make note of the file pathway that has been created for your new file.

  8. Select Save & Close.

2. Download and install the plugin

  1. Download the Add Custom JavaScript plugin for Joomla.

  2. In Joomla, go to System, then under Manage, select Extensions.

  3. Select Install Extensions.

  4. On the Upload Package File tab, select Or browse for file.

  5. Locate and select the plugin download file.

  6. Once you see the message to confirm that the plugin has successfully been installed, go to System, and under Manage, select Plugins.

  7. Search for Add custom Javascript, then select the X icon under Status to enable the plugin.

  8. Select the plugin name.

  9. For Javascript File 1 Path, enter the file pathway you noted in Step 1.
    You must not include the / character before the root file location. Your file pathway should look like this: media/templates/site/[template-name]/js/[file-name].

  10. Expand the Load File 1 in drop-down menu and select Front-end.

  11. In the right hand panel:

    1. Ensure that Status is set to Enabled.

    2. Ensure that Access is set to Public.

    3. Expand the Ordering drop-down menu and select End.

  12. Select Save & Close.

3. Check your script

You can visit your website and use your browser’s dev tools, or inspect the page source, to check that the script has been applied to your site.

For instructions on how to test that Dotdigital’s Web behavior tracking script is working correctly, see the section Check it’s working.


Add scripts to individual Joomla articles

1. Download and install the plugin

  1. Download the Sourcerer plugin for Joomla.

  2. In Joomla, go to System, then under Manage, select Extensions.

  3. Select Install Extensions.

  4. On the Upload Package File tab, select Or browse for file.

  5. Locate and select the plugin download file.

  6. Once you see the message to confirm that the plugin has successfully been installed, go to System, and under Manage, select Plugins.

  7. Search for Sourcerer, and ensure that the following plugins are set to Enabled:

    • Button - Regular Labs - Sourcerer

    • System - Regular Labs - Sourcerer

2. Add code to a Joomla article

  1. Go to Content > Articles.

  2. Select the article name that you want to edit.

  3. Place your cursor in the area where you want to place the code snippet, then expand the CMS Content drop-down menu and select Code.

  4. Paste your code snippet into the Code field.

  5. Select Insert.

  6. Select Save.

For further information or assistance on working with Joomla, see the Joomla support documentation or post queries in the Joomla forum for community support.

Did this answer your question?