{"id":1449,"date":"2024-12-03T07:42:47","date_gmt":"2024-12-03T07:42:47","guid":{"rendered":"https:\/\/gaconnector.com\/blog\/?p=1449"},"modified":"2024-12-04T13:12:59","modified_gmt":"2024-12-04T13:12:59","slug":"how-to-save-the-google-analytics-client-id-to-your-crm","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/blog\/how-to-save-the-google-analytics-client-id-to-your-crm\/","title":{"rendered":"How to Save the Google Analytics Client ID to your CRM"},"content":{"rendered":"<h2><strong>What is a Google Analytics Client ID?<\/strong><\/h2>\n<p>A Google Analytics Client ID is a unique identifier that is assigned by Google Analytics to a user when they first visit your website or app.<\/p>\n<p>The Client ID is stored in a user&#8217;s browser via cookies so user sessions and interactions across multiple sessions are tracked and retained for the duration of the cookie\u2019s lifespan.<\/p>\n<p>You can usually find the Client ID stored in the <strong>_ga cookie<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1467\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2024\/11\/client-id-example.jpg\" alt=\"\" width=\"612\" height=\"117\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2024\/11\/client-id-example.jpg 612w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2024\/11\/client-id-example-300x57.jpg 300w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/p>\n<ul>\n<li>The first part, 94226024, is a randomly generated number assigned to the user<\/li>\n<li>The second part is a timestamp indicating when the ID was created in unix format.<\/li>\n<\/ul>\n<h2><strong>Why should you send the Google Analytics client ID to your CRM?<\/strong><\/h2>\n<p>By enriching your CRM data with the Google Analytics ID, you can discover how leads find you and what they see before buying. This also provides other key advantages such as:<\/p>\n<ul>\n<li><strong>Identify which website sessions \/ activity belong to a known customer or lead.<br \/>\n<\/strong>Attribute anonymous browsing behavior (e.g., pages visited, products viewed) to a CRM contact\/lead once they submit a form or log in.<\/li>\n<li><strong>Better Reporting and Segmentation<br \/>\n<\/strong>By default, Google Analytics doesn&#8217;t track offline revenue. Sales are often closed by sales reps and only tracked in Salesforce or some other CRM software. Having the client ID data allows you to create combined reports and merge online behavior with offline data.<\/li>\n<li><strong>Personalization and Retargeting<br \/>\n<\/strong>By combining Client ID with your CRM data, you can use the data to create highly personalized retargeting campaigns based on website behavior.<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Sending the Google Analytics Client ID with your CRM allows opportunities for enhanced insights, improved personalization, and more effective decision-making. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This also allows you to answer questions like:<\/span><\/p>\n<ol>\n<li>How many of your website visitors actually became paying customers.<\/li>\n<li>Which campaigns, ads, blog posts and keywords drive the most qualified leads?<\/li>\n<li>Which traffic sources only drive junk traffic that distracts your sales reps from valuable customers that your company can actually help?<\/li>\n<\/ol>\n<h2><strong>Retrieving the Client ID and sending it to your CRM<\/strong><\/h2>\n<p>There are a lot of ways to send the client ID to your CRM. Today, we\u2019re going to show the most common method for most CRMs which is through a lead generation form.<\/p>\n<h3><strong>Setup your form<\/strong><\/h3>\n<ol>\n<li>Start by creating a new hidden input field on your form.<\/li>\n<li>Set the ID of the new input field to \u201c<strong>ga_client_id<\/strong>\u201d<\/li>\n<li>Note: Make sure that this new hidden field is properly mapped to your CRM to make sure that when the form is submitted, the values are stored in your CRM.<\/li>\n<\/ol>\n<h3><strong>Getting the Client ID<\/strong><\/h3>\n<p>You can retrieve the GA4 Client ID programmatically using the gtag.js library, or even directly from the cookies. Add this script after your form.<\/p>\n<p><strong>If using gtag.js<\/strong><\/p>\n<pre class=\"\"><script>\r\ngtag('get', 'G-XXXXXX', 'client_id', (clientID) => {\r\n    document.querySelector(\"#ga_client_id\").value = clientID;\r\n});\r\n<\/script>\r\n<\/pre>\n<p><strong><br \/>\nIf you are using Google Tag Manager, you can get it directly from the cookies<\/strong><\/p>\n<pre class=\"\"><script>\r\nvar cookie = {};\r\ndocument.cookie.split(';').forEach(function(el) {\r\n    var splitCookie = el.split('=');\r\n    var key = splitCookie[0].trim();\r\n    var value = splitCookie[1];\r\n    cookie[key] = value;\r\n});\r\ndocument.querySelector(\"#ga_client_id\").value = cookie[\"_ga\"].substring(6);\r\n<\/script><\/pre>\n<h2><strong>The easy method and taking it to the next level<\/strong><\/h2>\n<p>Depending on your CRM, lead generation form, or even how your website is built, saving the Client ID to your CRM isn\u2019t always straightforward.<\/p>\n<p>Another easy method is to use <a href=\"https:\/\/gaconnector.com\/\" target=\"_blank\" rel=\"noopener\">GA Connector<\/a>.<\/p>\n<p>GA Connector works with most CRMs such as Salesforce, Pipedrive, Zoho CRM and HubSpot. If you don&#8217;t have time to set up the integration yourself, our support team can always help.<\/p>\n<p>Aside from retrieving and sending the client ID, GA Connector can also track and send the following information to your CRM:<\/p>\n<h3><a class=\"btn btn-primary px-4\" href=\"#\" data-bs-toggle=\"modal\" data-bs-target=\"#trialmodal\">Start Your Free Trial Now!<\/a><\/h3>\n<p>30 Days &#8211; No credit card required<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is a Google Analytics Client ID? A Google Analytics Client ID is a unique identifier that is assigned by Google Analytics to a user when they first visit your website or app. The Client ID is stored in a user&#8217;s browser via cookies so user sessions and interactions across multiple sessions are tracked and&#8230;<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"yst_prominent_words":[330,325,223,21,16,329,323,595],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/1449"}],"collection":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/comments?post=1449"}],"version-history":[{"count":53,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/1449\/revisions"}],"predecessor-version":[{"id":1503,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/1449\/revisions\/1503"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/media?parent=1449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/categories?post=1449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/tags?post=1449"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=1449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}