Replace a text with an element in site

Hi I’m writing an app. The task of this app is to identify a URL ( refferer link) and to replace the telephone number or a image inside the site with another phone number or image . For example, if a person enters our site from site A , replace the phone number that is on the our site to X phone number, and if one enters our from site B, replace the phone number on the our site to Y . My code is as follows but it doesn’t work. Please guide me.

install.js

{
    "resources": {
        "body": [{
            "type": "script",
            "src": "./app.js"
        }]
    },
        "options": {
            "properties": {
                "referrer": {
                    "order": 1,
                    "type": "string",
                    "title": "The refferer url : "
                },
                "text": {
                    "order" : 2,
                    "type": "string",
                    "title": "Enter the phone number you want to replace",
                    "products": ["plus", "pro"]
                },
                "location": {
                    "title": "Location",
                    "description": "Select the part of your page which contains a Text ( for example : phone number) you’d like to change",
                    "type": "object",
                    "format": "element",
                    "default": {
                        "selector": "body",
                        "method": "prepend"
                      },
                    "order": 1
                },
                "slides": {
                    "title": "Slides",
                    "type": "array",
                    "maxItems": 10,
                    "order": 2,
                    "items": {
                      "type": "object",
                      "title": "Slide",
                      "properties": {
                        "image": {
                          "title": "Image",
                          "type": "string",
                          "order": 1,
                          "format": "image"
                        },
                        "description": {
                          "title": "Description",
                          "description": "This text is used as the image’s title and alt text, important for SEO.",
                          "default": "A wonderful image portraying a better future.",
                          "order": 2,
                          "type": "string",
                          "maxLength": 200
                        }
                }
            }
        }
            }       
        }

}

app.js

(function () {
    'use strict'

var options = INSTALL_OPTIONS
var element

if (document.referrer.trim() == option.refferer.trim()) {

    function updateElements () {
     element = INSTALL.createElement(options.location, element);
        if (!element) return
        element.textContent = options.text;
     }
    
}
}())

The security system does not allow such operations to be carried out within the CF network. If you do not use the CF network, then on your server the application will work without problems.

For development questions, use Stackoverflow