{"id":8,"date":"2017-01-24T13:32:03","date_gmt":"2017-01-24T13:32:03","guid":{"rendered":"http:\/\/gaconnector.com\/support\/?p=8"},"modified":"2020-09-22T07:08:45","modified_gmt":"2020-09-22T07:08:45","slug":"tag-adword-links","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/tag-adword-links\/","title":{"rendered":"Tag Adword Links"},"content":{"rendered":"<h2>Why Tagging\u00a0Google Ads Links is Necessary<\/h2>\n<p>GA Connector will automatically recognize leads coming from Google Ads, but by default &#8211; only source and medium parameters.<\/p>\n<p>In order to track campaigns and keywords too, you need to configure Google Ads to add UTM tags to\u00a0ad\u00a0links. GA Connector will pick up information from these tags and save it to the CRM.<\/p>\n<h2>Solution Overview<\/h2>\n<p>The most straightforward way to tag links it to add them to destination URLs for each ad. But it can be very time-consuming, plus editing ads will lose you the previous stats (as Google Ads\u00a0will consider them as new adverts).<\/p>\n<p>The easiest way is to add a\u00a0<em>final URL suffix<\/em>\u00a0to your\u00a0Google Ads account. It will append the UTM tags on the fly. We have created a script that will do it for you automatically.<\/p>\n<p>Here is how you can run this script in your\u00a0Google Ads account:<\/p>\n<ol>\n<li>Sign in to your account at\u00a0<a href=\"http:\/\/ads.google.com\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-saferedirecturl=\"https:\/\/www.google.com\/url?hl=en&amp;q=http:\/\/adwords.google.com&amp;source=gmail&amp;ust=1485342657459000&amp;usg=AFQjCNEUfZDM9JNtpc4-7P8_UiMRW2F1pg\">http:\/\/ads.google.com<\/a>.<\/li>\n<li>Click on Tools&amp;Settings &gt; Bulk Actions &gt; Scripts<br \/>\n<img decoding=\"async\" class=\"alignnone size-large wp-image-1809\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-700x242.png\" alt=\"\" width=\"700\" height=\"242\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-700x242.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-300x104.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-768x265.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-60x21.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1-150x52.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_1.png 1196w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>Click the &#8220;Add script&#8221; button.<br \/>\n<img decoding=\"async\" class=\"alignnone size-large wp-image-1810\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-700x118.png\" alt=\"\" width=\"700\" height=\"118\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-700x118.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-300x51.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-768x130.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-60x10.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2-150x25.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_2.png 1225w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>In the &#8220;Script name&#8221; field at the top, name your script &#8220;GA Connector UTM tagging&#8221;.<\/li>\n<li>In the script editor box, delete everything and make it completely empty.<\/li>\n<li>Paste the provided script instead:\n<pre class=\"lang:default decode:true \">function main() {\r\n\tvar campaignIterator = AdWordsApp.campaigns().get();\r\n\twhile (campaignIterator.hasNext()) {\r\n\t\tvar campaign = campaignIterator.next();\r\n\t\tvar campaignNameEncoded = encodeURIComponent(campaign.getName());\r\n\r\n\t\tvar adGroupIterator = campaign.adGroups().get();\r\n\t\twhile (adGroupIterator.hasNext()) {\r\n\t\t\tvar adGroup = adGroupIterator.next();\r\n\r\n\t\t\tvar oldUrlSuffix = adGroup.urls().getFinalUrlSuffix();\r\n\t\t\tif (oldUrlSuffix == null) {\r\n\r\n\t\t\t\tvar adGroupNameEncoded = encodeURIComponent(adGroup.getName());\r\n\t\t\t\tvar newUrlSuffix = \"utm_campaign=\" + campaignNameEncoded + \"&amp;utm_source=google&amp;utm_medium=cpc&amp;utm_content=\" + adGroupNameEncoded + \"&amp;utm_term={keyword}\";\r\n\t\t\t\tadGroup.urls().setFinalUrlSuffix(newUrlSuffix);\r\n\t\t\t\tLogger.log('Changing ad group \"' + adGroup.getName() + '\" of campaign \"' + campaign.getName() + '\" URL suffix to \"' + newUrlSuffix + '\"');\r\n\t\t\t} else {\r\n\t\t\t\tLogger.log('URL suffix for ad group \"' + adGroup.getName() + '\" of campaign \"' + campaign.getName() + '\" already exists: \"' + oldUrlSuffix + '\"');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n}<\/pre>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-1821\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-700x372.png\" alt=\"\" width=\"700\" height=\"372\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-700x372.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-300x160.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-768x408.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-60x32.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1-150x80.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_6-1.png 1452w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>Click &#8220;Run&#8221; above the editor.<\/li>\n<li>Authorize the script by clicking &#8220;Authorize&#8221; and then &#8220;Grant Access&#8221;.<br \/>\n<img decoding=\"async\" class=\"alignnone size-large wp-image-1816\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-700x319.png\" alt=\"\" width=\"700\" height=\"319\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-700x319.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-300x137.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-768x350.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-60x27.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4-150x68.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_4.png 1303w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>Click &#8220;Run&#8221; to run the script. If you get no errors, the script has been set up correctly.<\/li>\n<li>Finally, set the frequency to daily (so that when new ad groups are created, they are automatically tagged).<br \/>\n<img decoding=\"async\" class=\"alignnone size-large wp-image-1817\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-700x105.png\" alt=\"\" width=\"700\" height=\"105\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-700x105.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-300x45.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-768x115.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-60x9.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5-150x22.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2018\/07\/Screenshot_5.png 1227w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<\/ol>\n<div class=\"gmail_extra\">\n<h2>FAQ<\/h2>\n<h5>Will it change anything in the campaign?<\/h5>\n<p>No, it won&#8217;t. It will only change the final URL suffix, which can be deleted at any time.<\/p>\n<p>Actual links won&#8217;t be changed, but they will be modified on the fly.<br \/>\nBut this is completely reversible (you just need to remove the final URL suffix).<\/p>\n<h5>Can this script be applied at the MCC level, or just the account level?<\/h5>\n<p>This script can be applied to account level only.<\/p>\n<p><strong>I don&#8217;t see\u00a0&#8220;URL Options&#8221; inside\u00a0Google\u00a0Ads &#8211; Shared Library\u00a0menu. What do I do?<\/strong><\/p>\n<p>I can happen\u00a0because\u00a0Google Ads is testing a new version where there\u00a0is\u00a0no\u00a0&#8220;URL Options&#8221; inside that menu.\u00a0To fix this, you can temporarily return to the old version of Adwords (clicking the three dots button).<\/p>\n<p><strong>I&#8217;ve added the final URL suffix, but I still don&#8217;t see the UTM parameters being added to the links. What do I do?<\/strong><\/p>\n<p>If you encounter this problem, firstly check in the\u00a0Google Ads interface that the UTM parameters have in fact been added.<\/p>\n<p>If they were and you&#8217;re still not seeing UTM parameters in the URLs when you click your ads, you can try adding a forward slash &#8220;\/&#8221; at the end of your destination URLs (if it&#8217;s not there already). Some of our customers reported that\u00a0Google Ads didn&#8217;t\u00a0add the UTM parameters until they started ending their URLs with &#8220;\/&#8221;.<\/p>\n<p><strong>What if I already use\u00a0Google Ads auto-tagging? Do final URL suffixes interfere with it?<\/strong><\/p>\n<p>No, it does\u00a0not.\u00a0By default, Google Analytics uses auto-tagging data over manual UTM tags (which our final URL suffixes set).But GA also allows to set manual UTM tags to override auto-tagging:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-medium_large wp-image-230\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/a670973e579217889e1502600146281c-768x106.png\" alt=\"\" width=\"768\" height=\"106\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/a670973e579217889e1502600146281c-768x106.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/a670973e579217889e1502600146281c-300x42.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/a670973e579217889e1502600146281c-700x97.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/a670973e579217889e1502600146281c.png 1632w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<\/div>\n<p><strong>In case of GDN (Google Display Network) campaigns, how do we track the placement where the click originated from?<\/strong><\/p>\n<div>For GDN campaigns,\u00a0we suggest manually replacing the current\u00a0final URL suffixes with this one:<\/div>\n<div>utm_source=google&amp;utm_medium=<wbr \/>display&amp;utm_campaign=GDN_campaign&amp;utm_content={<wbr \/>placement}<\/div>\n<div><\/div>\n<div>As a result, leads that come from GDN campaigns will have the following differences from the ones that come from search ads:<\/div>\n<div>\n<ol>\n<li>Their utm_medium will be &#8220;display&#8221; instead of &#8220;cpc&#8221; &#8211; will help distinguish them.<\/li>\n<li>Their utm_content will contain the domain of the placement, and so will &#8220;Last Click Content&#8221; and &#8220;First Click Content&#8221;.<\/li>\n<\/ol>\n<p><strong>How to prevent Google from indexing versions of the page with and without UTM parameters?<\/strong><\/p>\n<\/div>\n<ol>\n<li>Specify a canonical URL on your pages.<\/li>\n<li>Instruct Google not to index the UTM parameters in Search Console<\/li>\n<li>Disallow the URL parameters in your robots.txt<\/li>\n<\/ol>\n<p>More details in\u00a0<a href=\"https:\/\/webmasters.stackexchange.com\/a\/102069\/29813\">this StackExchange answer<\/a>.<\/p>\n<p><strong>How long after implementing this instruction does it start working?<\/strong><\/p>\n<div>Immediately after applying the instruction, new\u00a0Google Ads visitors should\u00a0be tagged with UTM parameters.<\/div>\n<p>&nbsp;<\/p>\n<div>\n<div dir=\"auto\"><strong>Does this script work with Google Shopping campaigns?<\/strong><\/div>\n<div dir=\"auto\">\n<div>Unfortunately,\u00a0Google Ads scripts are currently unable to process shopping adgroups. Targeting template is not available to shopping adgroups, however it can be applied to the shopping campaign as a whole:<\/div>\n<div>\n<p>How to add\u00a0final URL suffix to your Shopping campaign?<\/p>\n<ol>\n<li>Click the\u00a0<strong>Campaigns<\/strong>\u00a0tab and select the campaign for which you&#8217;d like to change the final URL suffix.<\/li>\n<li>Click the\u00a0<strong>Settings\u00a0<\/strong>tab and scroll to the &#8220;Campaign URL options (Advanced)&#8221; section. Click the link.<\/li>\n<li>Click\u00a0<strong>Edit\u00a0<\/strong>and change your\u00a0final URL suffix in the box.<\/li>\n<li>Click<strong>\u00a0Save.<\/strong><\/li>\n<\/ol>\n<p>At the bottom of the campaign settings page you will see \u201c<strong>Campaign URL options (advanced)<\/strong>\u201c, select this and click \u201c<strong>Edit<\/strong>\u201d\u00a0to the right of \u00a0final URL suffix<\/p>\n<p>Add \u201c<strong><em>utm_campaign={campaignid}&amp;utm_source=google&amp;utm_medium=cpc<\/em><\/strong>\u201d to the text box that appears and hit \u201c<strong>Save<\/strong>\u201c.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2022\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/googleShopping.png\" alt=\"\" width=\"430\" height=\"111\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/googleShopping.png 430w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/googleShopping-300x77.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/googleShopping-60x15.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/01\/googleShopping-150x39.png 150w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<\/div>\n<div dir=\"auto\"><strong>Does this script work with Smart Campaigns?<\/strong><\/div>\n<div dir=\"auto\">Since the functionalities and features of Google Smart Campaigns are limited, the script will not work with Google Smart Campaign, however, you can manually set your ad link to include the UTM information.<\/div>\n<div dir=\"auto\">\n<ol>\n<li>Click the <strong>Campaigns tab <\/strong>and select the smart campaign for which you\u2019d like to add the UTM information<\/li>\n<li>On the ad preview section, click on <strong>Edit Ad<\/strong><\/li>\n<li>Add &#8216;<em>?utm_campaign={campaignid}&amp;utm_source=google&amp;utm_medium=cpc&amp;utm_term={keyword}<\/em>&#8216; at the end of your <strong>ad URL <\/strong>at the bottom of the screen.<br \/>\n(e.g &#8216;<em>https:\/\/mydomain.com?utm_campaign={campaignid}&amp;utm_source=google&amp;utm_medium=cpc&amp;utm_term={keyword}<\/em>&#8216;)<\/li>\n<li>Click<strong> Save<\/strong><\/li>\n<\/ol>\n<\/div>\n<div dir=\"auto\"><\/div>\n<div>\n<div dir=\"auto\"><strong>I&#8217;ve implemented this guide but it&#8217;s not working. What do I do?<\/strong><\/div>\n<div dir=\"auto\">Please try\u00a0<a href=\"https:\/\/gaconnector.com\/docs\/troubleshooting-guide-adwords-utm-tagging\/\">our troubleshooting guide<\/a> for\u00a0Google Ads UTM tagging.<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Why Tagging\u00a0Google Ads Links is Necessary GA Connector will automatically recognize leads coming from Google Ads, but by default &#8211; only source and medium parameters. In order to track campaigns and keywords too, you need to configure Google Ads to add UTM tags to\u00a0ad\u00a0links. GA Connector will pick up information from these tags and save [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/8"}],"collection":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":52,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"predecessor-version":[{"id":2606,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/8\/revisions\/2606"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}