The Google Tag Manager Gadget will help your website work better with different e-commerce transactions. It can reduce errors caused by code editing and quick updates to your store.
You need to install Google tag managerr on your site to eliminate the maintenance of code snippets in your source files. Moreover, it also allows for the development of tags and code on your website quickly and easily. All of these include Enhanced E-commerce, Google Remarketing, Facebook Pixel, etc., which will be easily managed.
To configure Google Optimize
Step 1: Install Mageplaza's Google Tag Manager
Step 2: Click on New Tag in the GTM account and change the name of the tag
Step 3: Choose Tag Configuration > Google Optimize
Step 4: Enter your Google Analytics Tracking ID and your Optimize container ID
Step 5: Click on more settings and configure the fields to set and advanced configurations as your Google analytics tags
Step 6: Select Save this tag without adding triggers.
Step 7: Open Google Analytics Page View tag, then choose Tag Configurations > Advanced Settings > Tag Sequencing. Next, click on Fire a Tag Before GA Pageview tag fires box and choose your Google Optimize tag as a Setup Tag.
Step 8: Finally, choose to Save the Google Analytics Pageview tag. And remember repeating this process on any other tags as relevant.
Detailed instructions: https://www.mageplaza.com/kb/how-con...magento-2.html