I'm currently designing applications with data coming from the data web connectors but you always need to specify a specific end date. I would like to have a dynamic time range in which the web connector always retrieves the most recent data.
You can convert from the system clock into a string like this:
let vEnd = Date(DayEnd(Now()), 'YYYYMMDDhhmmss');
let vStart = Date(DayStart(Now()-28), 'YYYYMMDDhhmmss');
You will need to change the format mask to match what Facebook is expecting.
You can then insert the variable into the load script in place of the date like this $(vEnd) and $(vStart).
If you are using Qlik Sense in Standard mode you will need to be using a recent version of sense (Feb 18 on, I think) and you can then use the WITH CONNECTION function to modify the dates from the defaults you put in when you create the connection.
If you search this forum you will find more details on WITH CONNECTION.
I never have to go in the script, I just enter the URL after which the data is added.
If I then after loading the data go to the script editor and put in the Let commands they give me an error and by then I can not edit the URL anymore. If I'm correct to use the script editor you need to disable standard mode which isn't possible in the Qlik Sense server version (the one i'm using)
Look on the right hand side of the load script, you should see a connection there. Copy the name of that in place of the GS name in my script. GS is the name that Sense gave me when I created a web connection in Data Manager - it may be that Sense picks something random here?