File Substitutions (Formerly Remote File Mapping)
File Substitution (Formerly Remote File Mapping) allows you to test new files, scripts, and libraries on pages in your production environment before coding the new one onto the page. File Substitution can be used in either Audits or Journeys and is very convenient for testing updated tag management systems before deployment.
Common Use Cases
Test a TMS migration - One important use case for File Substitution is to test the migration from one tag management system to another. Once your new tag management system is ready to be tested, use File Substitution to swap out the current file that loads your TMS and replace it with a reference to the new one. Check the Variable Summary report to spot any pages still loading the old one and to verify the new one loads each time.
Find tags loading outside of your TMS - Another use case is verifying that all your tags load from the tag management system. Unauthorized tags may be hard-coded on some pages without your knowledge, and would be hard to detect without File Substitution. If you replace the call to your TMS with a blank file, it effectively turns off the tag manager for the audit; any tag that loads comes from some source other than your tag manager. Because it is done in the audit, visitors to your site are completely unaffected. View the Tag Presence report to find any tags that load.
Test an update to your tag manager - Before deploying a new tag management version to your site, run an audit with File Substitution. Substitute the call to the old TMS with the new one to make sure all pages load the new TMS. The Tag Versions report can identify which version loads.
Test new tags and variables - Test a new tag from your tag manager by pointing to an instance where the new tag is configured. Look at the Variable Summary report to make sure it loads on every page and captures the right values.
Note: Successful configuration will not remove the tag from Tag Inventory and other reports in the Audit. It will neutralize it, making it unable to fire additional tags.
To set up a File Substitution you need to go to the Configurations and then the Remote File Mapping Library.
From there you'll click Create New to create a new mapping.
Click on the URL field and enter the URL or regular expression (regex) to match on. (For regex, all qualifying matches will be mapped to the new file.) This URL or regular expression value should match the current script URL or reference that is deployed on the page. Depending on the type of value, select the radio button that matches your entry. In the field under that, either enter a URL or upload a replacement file by clicking the blue text.
Note: If File Substitution is not replacing the file as expected, check to verify that the content type of the file being replaced matches the replacement file.
Looking At Results
In audits, look in the Page Summary report in the left-hand navigation bar of the audit results/report.
After you've run your Audit/Journey with File Substitution, the results are displayed in the reports. For Journeys, each action step shows the File Substitution request and whether the file passed or not.
Tag Initiators Tree View
You can view what and where something is substituted by clicking into an Audit Report, selecting Tag Health, clicking on a page URL, and selecting Tag Initiators. This is a great way to see if your File Substitutions are successful and on the pages that you are testing.