{"id":115,"date":"2018-03-10T14:54:00","date_gmt":"2018-03-10T14:54:00","guid":{"rendered":"https:\/\/capturly.com\/documentation\/?p=115"},"modified":"2023-02-01T11:39:08","modified_gmt":"2023-02-01T11:39:08","slug":"how-can-i-create-events","status":"publish","type":"post","link":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/","title":{"rendered":"How can I create custom events?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">You can create events by using custom variables. Using this method, you can filter the recording list based on visitor data (e.g. user id, email, newsletter campaign) or events (e.g. button clicked, video watched).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You will need to place the following line into your javascript code between &lt;script&gt; and &lt;\/script&gt; tags like shown in the example below:<\/span><\/p>\n<p><b>Note: <\/b><em><span style=\"font-weight: 400;\">Change the words \u2018LABEL\u2019, \u2018ACTION\u2019, \u2018VALUE\u2019 to your own data<\/span><\/em><\/p>\n<pre>&lt;script&gt;\n$('a.like').on('click', function(e){\n &nbsp;trq('set', 'likebutton', 'click', 'add');\n});\n&lt;\/script&gt;<\/pre>\n<p><span style=\"font-weight: 400;\">If you would like to add an event to your website, you will need permission to edit the code of your website. You can add as many custom events to your website as you want.<\/span><\/p>\n<p><b>Note:<\/b><span style=\"font-weight: 400;\"> If you are not familiar with coding, we recommend to contact a developer to add the custom events to your website. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s have an example. Here we have the code snippet of a button. The class and the style attributes may differ in your case, but it will be very similar for every HTML button on the web.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-240 \" src=\"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-1024x162.png\" alt=\"capturly create custom events 1\" width=\"802\" height=\"127\" srcset=\"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-1024x162.png 1024w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-300x47.png 300w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-768x121.png 768w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-60x9.png 60w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-150x24.png 150w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1.png 1420w\" sizes=\"(max-width: 802px) 100vw, 802px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">If we would like to add a click action custom event to this button, the only thing we have to do is simply add the onlick event attribute to the button and <\/span><a href=\"https:\/\/capturly.com\/documentation\/what-does-an-event-exactly-mean\/\"><span style=\"font-weight: 400;\">set the parameters of the custom event.<\/span><\/a><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-241  aligncenter\" src=\"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-1024x104.png\" alt=\"capturly create custom event 2\" width=\"837\" height=\"85\" srcset=\"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-1024x104.png 1024w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-300x31.png 300w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-768x78.png 768w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-60x6.png 60w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2-150x15.png 150w, https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-2.png 1946w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In this case, the <strong>onclick<\/strong> event attribute will call the <strong>trq function<\/strong> of Capturly on each button click, which will send the parameters to Capturly.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">After a custom event is set, it will be sent to Capturly each time the given action is made on your website. You will find your tracked custom events in the <\/span><b>Events<\/b><span style=\"font-weight: 400;\"> submenu under the <\/span><b>Acquisition <\/b><span style=\"font-weight: 400;\">menu.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can create events by using custom variables. Using this method, you can filter the recording list based on visitor data (e.g. user id, email, newsletter campaign) or events (e.g. button clicked, video watched). You will need to place the following line into your javascript code between &lt;script&gt; and &lt;\/script&gt; tags like shown in the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How can I create custom events? - Capturly Documentation<\/title>\n<meta name=\"description\" content=\"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).\" \/>\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\/how-can-i-create-events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How can I create custom events? - Capturly Documentation\" \/>\n<meta property=\"og:description\" content=\"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/\" \/>\n<meta property=\"og:site_name\" content=\"Capturly Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-10T14:54:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-01T11:39:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-1024x162.png\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/\",\"url\":\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/\",\"name\":\"How can I create custom events? - Capturly Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/capturly.com\/documentation\/#website\"},\"datePublished\":\"2018-03-10T14:54:00+00:00\",\"dateModified\":\"2023-02-01T11:39:08+00:00\",\"author\":{\"@id\":\"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d\"},\"description\":\"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).\",\"breadcrumb\":{\"@id\":\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/capturly.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How can I create custom events?\"}]},{\"@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 can I create custom events? - Capturly Documentation","description":"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).","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\/how-can-i-create-events\/","og_locale":"en_US","og_type":"article","og_title":"How can I create custom events? - Capturly Documentation","og_description":"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).","og_url":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/","og_site_name":"Capturly Documentation","article_published_time":"2018-03-10T14:54:00+00:00","article_modified_time":"2023-02-01T11:39:08+00:00","og_image":[{"url":"https:\/\/capturly.com\/documentation\/wp-content\/uploads\/2018\/03\/event-1-1024x162.png"}],"author":"Gabriella J\u00e1mbor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gabriella J\u00e1mbor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/","url":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/","name":"How can I create custom events? - Capturly Documentation","isPartOf":{"@id":"https:\/\/capturly.com\/documentation\/#website"},"datePublished":"2018-03-10T14:54:00+00:00","dateModified":"2023-02-01T11:39:08+00:00","author":{"@id":"https:\/\/capturly.com\/documentation\/#\/schema\/person\/0b8e591793613c3903a843ba859ffa8d"},"description":"Create custom events using custom variables and filter visitor data (e.g. user id, email) and actions (e.g. button clicks, video watches).","breadcrumb":{"@id":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/capturly.com\/documentation\/how-can-i-create-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/capturly.com\/documentation\/how-can-i-create-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/capturly.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"How can I create custom events?"}]},{"@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\/115"}],"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=115"}],"version-history":[{"count":3,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/posts\/115\/revisions\/769"}],"wp:attachment":[{"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/capturly.com\/documentation\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}