This scripts is to send Google Ads Hosted conversions into Google Analytics.
The issue with Google Ads is that it will not export goals or sync up with Google Analytics.
The script will send "calls from ads" goals into your Google Analytics account each morning so you and your customers can have great visibility of campaign performance.
To use this script copy and paste it into your Google Ads account in the script settings. In the script itself, click the advanced settings at the top right and to turn on the Google Analtyics API.
Update the variables to use your client's google analytics UA code and the website hostname. The hostname ensures that traffic is attributed to your website, any spam filters you have setup will still work once you have updated the hostname.
Set the script to run at 4-6am each day because it can take several hours for conversions to come through and the script will round up nearst whole number for you.