Hi …
You mention that you have attempted to add code on your dynamic page. What type of page is this? Is it a Wix Stores page or custom dynamic page that you created from your own custom database collection?
If it is a Wix Stores page, then please follow the tutorial video and example code once again. (We use ‘getProduct’ not ‘getItems’ in our example code)
If it is a custom dynamic page that you have created then you must get the current item from the dynamic dataset in order to obtain it’s ID.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem