A common use for extensions is to set a default value for a data layer variable. This requires setting the value of a variable – but only if it does not already have a value. In this step you will use the Set Data Values extension to set page_name to the value of a built-in variable named document title – but only if page_name does not have a value.

Use the following steps to add this extension:

  1. In the sidebar, select iQ Tag Management > Extensions.
  2. Click + Add Extension.
  3. Under the Standard Data tab, click + Add next to Set Data Values.
  4. In the Title field, enter Default Page Name to identify your extension.
  5. In the Scope field, keep the All Tags - After Load Rules (default) default value.
  6. Under Configuration, apply the following settings:
    • Use the drop-down list in the Set field to select the Page Name variable.
    • In the To field, select Variable.
    • In the variables drop-down list, select document title.
    • Under Condition, click Add Condition.
    • Use the drop-down list to select the Page Name variable.
    • In the next field, use the drop-down list to select is not populated.

That's it! Your extension is configured. This extension ensures that if your data layer does not contain a value for the page_name variable, then the value of document title will be used instead. This is just one example of an extension. Be sure to explore the other extensions.

You're in the homestretch. Click Next to move on to the final steps of saving and publishing your work.