Code works in preview but not in live site

All the collection permissions are set to Admin only (as it’s a dashboard page). There is only one item in the collection, and it has been synced to live. Unless there’s something else I’ve missed, in live nothing happens at all.