You can add custom ads to a page or sidebar using the Custom HTML widget. Place the ad code you have generated into this widget.
Important: Do not add </script> tags as you would when adding code in your Advertising settings. Only include the ad code itself within the Custom HTML widget.