You should use Shopify's modern Customer Events system. This method is the most reliable and future-proof way to add the necessary code.
Go to Settings > Customer events in your Shopify admin.
Click Add custom pixel and give it a name like "Google Ads Enhanced Conversions."
You will need a specific code snippet that subscribes to the checkout_completed event and sends user data to your Google Ads tag. You can find up-to-date, ready-to-use code templates from developer resources or your marketing agency.
Paste the code, replacing the placeholder values (AW-CONVERSION_ID and AW-CONVERSION_LABEL) with your own. Save and connect the pixel.
Also, for Add to Cart and Begin Checkout
The process for these actions is similar to the purchase conversion but involves different events.
For 'Begin Checkout': Use a code snippet that subscribes to the checkout_started event in the Customer Events section.
For 'Add to Cart': Use a code snippet that subscribes to the product_added_to_cart event.
After implementing the code, go back to your Google Ads account and validate the setup from the Diagnostics section of your conversion action. This will confirm that the data is now being received correctly.
Here if you are using a Plus Plan, you can check this out: https://publicityport.com/awc/5528/have-shopify-implement-enhanced-conversions-editing-theme