{"id":13467,"date":"2018-09-25T16:16:01","date_gmt":"2018-09-25T15:16:01","guid":{"rendered":"https:\/\/www.orchidbox.com\/?p=13467"},"modified":"2024-04-18T06:04:58","modified_gmt":"2024-04-18T06:04:58","slug":"inject-google-analytics-client-id-to-all-your-links","status":"publish","type":"post","link":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/","title":{"rendered":"Inject Google Analytics Client ID to All Your Links"},"content":{"rendered":"<p>We have been playing with\u00a0<strong>Google Analytics Client ID<\/strong>\u00a0and found that not many agencies have been using it.<\/p>\n<p>The Client ID can be found in the\u00a0<strong>GA cookie<\/strong>\u00a0and Client ID is stored on the\u00a0<strong>GA cookie<\/strong>\u00a0of your website\u2019s actual domain.<\/p>\n<p>Google Analytics stores a unique identifier for every user who visits your site within a first-party cookie. This value, in GA parlance, is called the Client ID, and the name of the cookie is _ga.<\/p>\n<p>Here\u2019s what the entire cookie string looks like, with the actual Client ID bolded:<br \/>\n<strong>2139536866.1471456764<\/strong><\/p>\n<p>Client ID could be extremely useful if you are trying to track a multichannel behaviour:<\/p>\n<p>User clicks on a Display ad, then clicks on an Affiliate link, then sees a Twitter ad, then searches through Google, then converts. You can capture all these separate interactions with Client ID.<\/p>\n<p>Adding this simple JS code to your analytics will enable you to add client ID reference to all your urls.<\/p>\n<p><code>ga(function(tracker) {<br \/>\nvar clientId = tracker.get('clientId');<br \/>\njQuery(document).ready(function($){<br \/>\nvar href = $(\"a\").attr('href') + \"&amp;id=\" + clientId;<br \/>\n$(\"a\").attr(\"href\", href);<br \/>\n});<br \/>\n});<br \/>\n<\/code><br \/>\nOnce this code is installed, you will be able to filter pages by\u00a0<strong>Client ID<\/strong>.<\/p>\n<p>Feel free to change the code when necessary or get in touch for a code customisation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have been playing with\u00a0Google Analytics Client ID\u00a0and found that not many agencies have been using it. The Client ID can be found in the\u00a0GA cookie\u00a0and Client ID is stored on the\u00a0GA cookie\u00a0of your website\u2019s actual domain. Google Analytics stores a unique identifier for every user who visits your site within a first-party cookie. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":14807,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-13467","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Inject Google Analytics Client ID to All Your Links - Orchid Box Insights<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Inject Google Analytics Client ID to All Your Links - Orchid Box Insights\" \/>\n<meta property=\"og:description\" content=\"We have been playing with\u00a0Google Analytics Client ID\u00a0and found that not many agencies have been using it. The Client ID can be found in the\u00a0GA cookie\u00a0and Client ID is stored on the\u00a0GA cookie\u00a0of your website\u2019s actual domain. Google Analytics stores a unique identifier for every user who visits your site within a first-party cookie. This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\" \/>\n<meta property=\"og:site_name\" content=\"Orchid Box Insights\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-25T15:16:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-18T06:04:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1792\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"frank\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"frank\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\"},\"author\":{\"name\":\"frank\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/d0e37cec33581140df37c170d90868db\"},\"headline\":\"Inject Google Analytics Client ID to All Your Links\",\"datePublished\":\"2018-09-25T15:16:01+00:00\",\"dateModified\":\"2024-04-18T06:04:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\"},\"wordCount\":202,\"publisher\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp\",\"articleSection\":[\"Technical\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\",\"url\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\",\"name\":\"Inject Google Analytics Client ID to All Your Links - Orchid Box Insights\",\"isPartOf\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp\",\"datePublished\":\"2018-09-25T15:16:01+00:00\",\"dateModified\":\"2024-04-18T06:04:58+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage\",\"url\":\"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp\",\"contentUrl\":\"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp\",\"width\":1792,\"height\":1024},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#website\",\"url\":\"https:\/\/www.orchidbox.com\/insights\/\",\"name\":\"Orchid Box Insights\",\"description\":\"Whether you&#039;re navigating the intricacies of SEO, exploring the nuances of pay-per-click advertising, or crafting compelling marketing campaigns, our posts are designed to provide you with the knowledge and tools necessary for success. At Orchid Box, we pride ourselves on delivering industry-leading advice that enhances website visibility, engages audiences, and maximizes return on investment. Stay ahead of the curve with our in-depth articles on SEO, PPC, and digital marketing.\",\"publisher\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.orchidbox.com\/insights\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#organization\",\"name\":\"Orchid Box\",\"url\":\"https:\/\/www.orchidbox.com\/insights\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wwww.orchidbox.com\/insights\/wp-content\/uploads\/2024\/06\/symbol.png\",\"contentUrl\":\"https:\/\/wwww.orchidbox.com\/insights\/wp-content\/uploads\/2024\/06\/symbol.png\",\"width\":401,\"height\":400,\"caption\":\"Orchid Box\"},\"image\":{\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/d0e37cec33581140df37c170d90868db\",\"name\":\"frank\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/45b74e4b9bbcfe0dcf2d7dca07222cc3eccf37085a34710d2ec2ea42d00b3c25?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/45b74e4b9bbcfe0dcf2d7dca07222cc3eccf37085a34710d2ec2ea42d00b3c25?s=96&d=mm&r=g\",\"caption\":\"frank\"},\"sameAs\":[\"https:\/\/orchidbox.com\/insights\/\"],\"url\":\"https:\/\/www.orchidbox.com\/insights\/author\/frank\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Inject Google Analytics Client ID to All Your Links - Orchid Box Insights","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/","og_locale":"en_US","og_type":"article","og_title":"Inject Google Analytics Client ID to All Your Links - Orchid Box Insights","og_description":"We have been playing with\u00a0Google Analytics Client ID\u00a0and found that not many agencies have been using it. The Client ID can be found in the\u00a0GA cookie\u00a0and Client ID is stored on the\u00a0GA cookie\u00a0of your website\u2019s actual domain. Google Analytics stores a unique identifier for every user who visits your site within a first-party cookie. This [&hellip;]","og_url":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/","og_site_name":"Orchid Box Insights","article_published_time":"2018-09-25T15:16:01+00:00","article_modified_time":"2024-04-18T06:04:58+00:00","og_image":[{"width":1792,"height":1024,"url":"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp","type":"image\/webp"}],"author":"frank","twitter_card":"summary_large_image","twitter_misc":{"Written by":"frank","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#article","isPartOf":{"@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/"},"author":{"name":"frank","@id":"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/d0e37cec33581140df37c170d90868db"},"headline":"Inject Google Analytics Client ID to All Your Links","datePublished":"2018-09-25T15:16:01+00:00","dateModified":"2024-04-18T06:04:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/"},"wordCount":202,"publisher":{"@id":"https:\/\/www.orchidbox.com\/insights\/#organization"},"image":{"@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage"},"thumbnailUrl":"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp","articleSection":["Technical"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/","url":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/","name":"Inject Google Analytics Client ID to All Your Links - Orchid Box Insights","isPartOf":{"@id":"https:\/\/www.orchidbox.com\/insights\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage"},"image":{"@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage"},"thumbnailUrl":"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp","datePublished":"2018-09-25T15:16:01+00:00","dateModified":"2024-04-18T06:04:58+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.orchidbox.com\/insights\/inject-google-analytics-client-id-to-all-your-links\/#primaryimage","url":"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp","contentUrl":"https:\/\/www.orchidbox.com\/insights\/wp-content\/uploads\/2024\/03\/orchid_box_marketing_9-1.webp","width":1792,"height":1024},{"@type":"WebSite","@id":"https:\/\/www.orchidbox.com\/insights\/#website","url":"https:\/\/www.orchidbox.com\/insights\/","name":"Orchid Box Insights","description":"Whether you&#039;re navigating the intricacies of SEO, exploring the nuances of pay-per-click advertising, or crafting compelling marketing campaigns, our posts are designed to provide you with the knowledge and tools necessary for success. At Orchid Box, we pride ourselves on delivering industry-leading advice that enhances website visibility, engages audiences, and maximizes return on investment. Stay ahead of the curve with our in-depth articles on SEO, PPC, and digital marketing.","publisher":{"@id":"https:\/\/www.orchidbox.com\/insights\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.orchidbox.com\/insights\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.orchidbox.com\/insights\/#organization","name":"Orchid Box","url":"https:\/\/www.orchidbox.com\/insights\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.orchidbox.com\/insights\/#\/schema\/logo\/image\/","url":"https:\/\/wwww.orchidbox.com\/insights\/wp-content\/uploads\/2024\/06\/symbol.png","contentUrl":"https:\/\/wwww.orchidbox.com\/insights\/wp-content\/uploads\/2024\/06\/symbol.png","width":401,"height":400,"caption":"Orchid Box"},"image":{"@id":"https:\/\/www.orchidbox.com\/insights\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/d0e37cec33581140df37c170d90868db","name":"frank","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.orchidbox.com\/insights\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/45b74e4b9bbcfe0dcf2d7dca07222cc3eccf37085a34710d2ec2ea42d00b3c25?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/45b74e4b9bbcfe0dcf2d7dca07222cc3eccf37085a34710d2ec2ea42d00b3c25?s=96&d=mm&r=g","caption":"frank"},"sameAs":["https:\/\/orchidbox.com\/insights\/"],"url":"https:\/\/www.orchidbox.com\/insights\/author\/frank\/"}]}},"_links":{"self":[{"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/posts\/13467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/comments?post=13467"}],"version-history":[{"count":2,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/posts\/13467\/revisions"}],"predecessor-version":[{"id":14872,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/posts\/13467\/revisions\/14872"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/media\/14807"}],"wp:attachment":[{"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/media?parent=13467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/categories?post=13467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orchidbox.com\/insights\/wp-json\/wp\/v2\/tags?post=13467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}