Hey @Joachim_B, My theory is this doesn’t work too well with collection template pages. I tried running the script on a static page, a collection template page, and as a collection item on a static page.
The only scenario that didn’t want to run properly was the collection template page. I would join the @Finsweetattribute slack group and see if there’s a running issue in that group.