Hi lokendras11872334,
You can create a Page Load Rule under which you can add Third Party Tags for your script and condition for the rule should be based on the way pageName is being populated.
If there is a Data Element which is populating the pageName, check for the Data Elements value in condition. If this doesn't work (rule doesn't fire), it means that the data element is not populated by the time rule condition is checked and hence you need to trigger rule lower in load order.
If pageName is being populated through custom script or an object on page, you can use the same object in rule condition as custom script.