{"id":859,"date":"2023-08-24T09:16:18","date_gmt":"2023-08-24T09:16:18","guid":{"rendered":"https:\/\/capturly.com\/documentation\/?p=859"},"modified":"2023-08-24T09:17:37","modified_gmt":"2023-08-24T09:17:37","slug":"create-custom-events-in-gtm","status":"publish","type":"post","link":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/","title":{"rendered":"How to Create Custom Events in Google Tag Manager"},"content":{"rendered":"\n<p>First, you\u2019ll need to install Capturly to Google Tag Manager. Let us guide you through an example of setting up a custom event. We will create an event for our \u201cGet in touch\u201d button on our pricing page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/nfYUc6tekhFgLaOdyOOSonsJfotWrhPcd40tq-OnbIW2D3DiPc9UbcE6E4-Ja0g87uU6KjCut_CubGMDgX2DN0Acm0QVw55kqDAwmnvT1fCyfiudJfTgUsyMEdrX12Lo2HXfVwl4GNgpj-SoZ7Ff3w8\" alt=\"\"\/><\/figure>\n\n\n\n<ol>\n<li>Open Google Tag Manager and create a new tag.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/NNu_9E1i4GR2t5n--7v6DPoUsmCZCEY4KnxkWJugui8dG7QyvghQA6ahsqblUAT_YG4hYnOq72yL9JnR9r3ZflBL3QZvcAd_dc1hLOGIkzhzOs5m7KSqLtRH_E6-7z_F4v255uC35-Pb40AozN-TEQ0\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"2\">\n<li>Click on Tag Configuration and select &#8220;Custom HTML tag&#8221;.<\/li>\n\n\n\n<li>Define your tag by including the Capturly custom events script:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;script&gt;\n&nbsp;&nbsp;trq('set',&nbsp; 'label',&nbsp; 'action',&nbsp; 'value');\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>In this example:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;script&gt;\n&nbsp;&nbsp;trq('set',&nbsp; 'get_in_touch',&nbsp; 'click',&nbsp; 'pricing');\n&lt;\/script&gt;<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/ZuFdiGjjuQ5c98D4fiLUuSwY8QJ8sDPQPfWafyPNBiQVye7bLbvCv5-4ZtwvQdXpaOWyuzNx44b7X9B6Y-Ozn4x1aAqcEnsqO4HrpIJ-4YI_pm70hJJscx29AiC0mvENCU6JhVGvVsckmyOP3kIGOlY\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"4\">\n<li>Click &#8220;Triggering&#8221; to initiate the trigger configuration.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/fPHoiVTg7jzi_811LZU8QW-O2g7R9uI3DbQK7QpTcwHHgDLfeegwVVjqFEbVTsu1sohKkLfZK7F-fNEMDaq0YW79T5JCWTthd9gJQChV5EZVFpg18b1UDzcgBtqSczx3hEW23peUiLGUDiE1owJPAhQ\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"5\">\n<li>Press the &#8220;+&#8221; button to add a new trigger. Then, start the trigger configurations.<\/li>\n\n\n\n<li>Under the &#8220;Click&#8221; category, select &#8220;All Elements&#8221;.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/77D32waPI5C0U1zaHNCW7jsMF5cXs-7puLWNYzYux6ksm0zD_jOfxLX-gK4eae8G67Mr5QlJlXi3aHq3GNSUbUCGLaGCGG9meCmcxugGlwI_Di9k0T5bw2ZN_nQC7kggK2xFZ8BQloabv-LY-N8tGPo\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"7\">\n<li>In &#8220;Trigger Configuration,&#8221; choose &#8220;Some clicks.&#8221;\n<ul>\n<li>Here, you can set conditions that will fire the trigger. By default, you can set up Page Host Name, Page Path, Page URL, and Referrer. If you don&#8217;t find the preferred option, select the &#8220;Choose built-in variables&#8221; option.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Ave9rdgm0WFwi3EY5fMPF3Z8OkZsY8gHzuYmLwhW-9V7NTV-uOMZKz8mRKQEdraQgHp1RZ27wBvtFoouZbC87frNicHRQt7YgLTtC4sZMapFaY84BuOc1XOJrfCQpkT1ANVsH6-brHTSU2mGJZwb-og\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"8\">\n<li>Configure additional variables as a condition (if it\u2019s needed)\n<ul>\n<li>You can customize and specify the conditions with built-in variables like click classes, click ID, form ID, and many more.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/tIIzVxbU_pUahC1Q8TpE9D_QM4qBK5xLU3w_tAhtwmiNZKqsFe52mP9KQK1T9rWklzCq9EsXGTuJJRj_ryv43NGymzNPqqQpNTw0BKyifdOWcTAOKQfV8YUwt1DpKW24N6xnLWfZoF-NwQtJdRE1WRg\" alt=\"\"\/><\/figure>\n\n\n\n<p>In this example: we defined the button based on the click class from the HTML code by adding a \u201ccontains\u201d condition. Since click classes don\u2019t have unique values in many cases, we also defined the URL where the button is placed.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/Uj1DePLE5B4z9oI8EBAB-8G6HoPsxfBZqfPzxL67KdMtdj95WErxDlWx9epcWCYucSjPdVELyMbqC2QU7dECkcByxm8Z1DPXszyH9RTTpIyAHGdjqd9XepTNWRNWghfUyZkqPkULv0mECYwKELxDJqc\" alt=\"\" width=\"643\" height=\"201\"\/><\/figure><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/ye3uEoJCRWBEIOPA6rVKAdHzSnbsknRsRnkUEeRA_dobV25pFp8OF6Qq_oikTbr-r46SIwt-Nz-Y7ZPncwSgUUCBT9VqIWxyo8t6-xZEN_RUFoghU-GzeCCJhmKGI2E8nyEuocx0VB8BxhD8OY_UEMw\" alt=\"\"\/><\/figure>\n\n\n\n<p>Note: Please remember that between these conditions there is an AND condition, meaning the event will be triggered when ALL of these conditions are true.&nbsp;<\/p>\n\n\n\n<ol start=\"9\">\n<li>Save.<\/li>\n\n\n\n<li>If you\u2019d like to check everything was set up correctly, just click on the \u201cPreview\u201d.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/7tedsFv8EgzqmnJ40eEBHmrhEME2zsIDOyFIa3Z5kQfA9GuEsZ4pImXsbGW1Efij9oGMkvQfU6MuvqET-sNMqGuIFrm2KkzA43zMjXLLJ8jSFS2WxmwweRjLOHFTA6Zl6Dsi_xCxF3vPKF9Ls_kMRwk\" alt=\"\"\/><\/figure>\n\n\n\n<ol start=\"11\">\n<li>Type your website\u2019s URL and click Connect. Your website will then open in Debug Mode.<\/li>\n\n\n\n<li>Click on the website element that was set up as an event.<\/li>\n<\/ol>\n\n\n\n<p>Note: You can also set up custom events that are not triggered by clicks but by viewing, watching images, or videos.<\/p>\n\n\n\n<ol start=\"13\">\n<li>If it&#8217;s set up correctly, you will see that the event was fired in the Debug Panel.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/uwp2cx6KkNEPmldgnDRIoNsbA_8qyR1fuEAxbdkrrgBG3ZSu2dvTSg4YYWfEmgkdoDhK0P4Ax-nBsCOHgG8MTTqeGwiMgVMx8DoRSLdsgyWdgqrITLkWkG2x-3S5KxDBwhtZilo8FyrL2xIlqJWKayY\" alt=\"\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>First, you\u2019ll need to install Capturly to Google Tag Manager. Let us guide you through an example of setting up a custom event. We will create an event for our \u201cGet in touch\u201d button on our pricing page. &lt;script&gt; &nbsp;&nbsp;trq(&#8216;set&#8217;,&nbsp; &#8216;label&#8217;,&nbsp; &#8216;action&#8217;,&nbsp; &#8216;value&#8217;); &lt;\/script&gt; In this example:&nbsp; &lt;script&gt; &nbsp;&nbsp;trq(&#8216;set&#8217;,&nbsp; &#8216;get_in_touch&#8217;,&nbsp; &#8216;click&#8217;,&nbsp; &#8216;pricing&#8217;); &lt;\/script&gt; In this [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create Custom Events in Google Tag Manager - Capturly Documentation<\/title>\n<meta name=\"description\" content=\"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Custom Events in Google Tag Manager - Capturly Documentation\" \/>\n<meta property=\"og:description\" content=\"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/\" \/>\n<meta property=\"og:site_name\" content=\"Capturly Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-24T09:16:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-24T09:17:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lh5.googleusercontent.com\/nfYUc6tekhFgLaOdyOOSonsJfotWrhPcd40tq-OnbIW2D3DiPc9UbcE6E4-Ja0g87uU6KjCut_CubGMDgX2DN0Acm0QVw55kqDAwmnvT1fCyfiudJfTgUsyMEdrX12Lo2HXfVwl4GNgpj-SoZ7Ff3w8\" \/>\n<meta name=\"author\" content=\"Gabriella J\u00e1mbor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gabriella J\u00e1mbor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/\",\"url\":\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/\",\"name\":\"How to Create Custom Events in Google Tag Manager - Capturly Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/capturly.com\/documentation\/#website\"},\"datePublished\":\"2023-08-24T09:16:18+00:00\",\"dateModified\":\"2023-08-24T09:17:37+00:00\",\"author\":{\"@id\":\"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d\"},\"description\":\"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.\",\"breadcrumb\":{\"@id\":\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/capturly.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Custom Events in Google Tag Manager\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/capturly.com\/documentation\/#website\",\"url\":\"https:\/\/capturly.com\/documentation\/\",\"name\":\"Capturly Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/capturly.com\/documentation\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d\",\"name\":\"Gabriella J\u00e1mbor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/capturly.com\/documentation\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5044a2221efb4543c929245d16082362?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5044a2221efb4543c929245d16082362?s=96&d=mm&r=g\",\"caption\":\"Gabriella J\u00e1mbor\"},\"sameAs\":[\"http:\/\/capturly.com\"],\"url\":\"https:\/\/capturly.com\/documentation\/author\/gabriella\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Custom Events in Google Tag Manager - Capturly Documentation","description":"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.","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:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Custom Events in Google Tag Manager - Capturly Documentation","og_description":"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.","og_url":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/","og_site_name":"Capturly Documentation","article_published_time":"2023-08-24T09:16:18+00:00","article_modified_time":"2023-08-24T09:17:37+00:00","og_image":[{"url":"https:\/\/lh5.googleusercontent.com\/nfYUc6tekhFgLaOdyOOSonsJfotWrhPcd40tq-OnbIW2D3DiPc9UbcE6E4-Ja0g87uU6KjCut_CubGMDgX2DN0Acm0QVw55kqDAwmnvT1fCyfiudJfTgUsyMEdrX12Lo2HXfVwl4GNgpj-SoZ7Ff3w8"}],"author":"Gabriella J\u00e1mbor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gabriella J\u00e1mbor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/","url":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/","name":"How to Create Custom Events in Google Tag Manager - Capturly Documentation","isPartOf":{"@id":"https:\/\/capturly.com\/documentation\/#website"},"datePublished":"2023-08-24T09:16:18+00:00","dateModified":"2023-08-24T09:17:37+00:00","author":{"@id":"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d"},"description":"Learn how to create custom events in GTM for Capturly to easier track and analyze user bahevior on your website.","breadcrumb":{"@id":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/capturly.com\/documentation\/create-custom-events-in-gtm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/capturly.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"How to Create Custom Events in Google Tag Manager"}]},{"@type":"WebSite","@id":"https:\/\/capturly.com\/documentation\/#website","url":"https:\/\/capturly.com\/documentation\/","name":"Capturly Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/capturly.com\/documentation\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d","name":"Gabriella J\u00e1mbor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/capturly.com\/documentation\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5044a2221efb4543c929245d16082362?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5044a2221efb4543c929245d16082362?s=96&d=mm&r=g","caption":"Gabriella J\u00e1mbor"},"sameAs":["http:\/\/capturly.com"],"url":"https:\/\/capturly.com\/documentation\/author\/gabriella\/"}]}},"_links":{"self":[{"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts\/859"}],"collection":[{"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/comments?post=859"}],"version-history":[{"count":6,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts\/859\/revisions"}],"predecessor-version":[{"id":936,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts\/859\/revisions\/936"}],"wp:attachment":[{"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/media?parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/categories?post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/tags?post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}