{"id":2340,"date":"2025-06-12T15:46:12","date_gmt":"2025-06-12T13:46:12","guid":{"rendered":"https:\/\/upendo.com\/?post_type=macros_pt&#038;p=2340"},"modified":"2025-06-12T16:08:25","modified_gmt":"2025-06-12T14:08:25","slug":"een-specifieke-variabele-ophalen-uit-een-array-van-objecten-2","status":"publish","type":"macros_pt","link":"https:\/\/upendo.com\/nl\/macros\/een-specifieke-variabele-ophalen-uit-een-array-van-objecten-2","title":{"rendered":"Deel waarde door getal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Deze is vrij eenvoudig maar nuttig! Je GTM-variabele wordt gesplitst door een ingesteld getal en dit wordt uitgevoerd. <\/p>\n\n<h2 class=\"wp-block-heading\" id=\"usecase\">Usecase<\/h2>\n\n<p class=\"wp-block-paragraph\">Deze macro kan handig zijn als je een conversiewaarde of een ander getal moet splitsen.<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"instructions\">Instructies<\/h2>\n\n<ul class=\"wp-block-list\">\n<li>Vervang {{var_value}} door een variabele in je GTM-container. Houd er rekening mee dat dit alleen getallen mogen zijn. <\/li>\n\n\n\n<li>Vervang de \u201c2\u201d door een getal waar je het door wilt delen.<\/li>\n<\/ul>\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>\/\/ Voorbeeld invoer: 10\n\/\/ Voorbeeld uitvoer: 5\n\nfunctie () {\n return {{var_value}} \/ 2;\n}<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">\/\/ Input example: 10<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/\/ Output example: 5<\/span><\/span>\n<span class=\"line\"\/>\n<span class=\"line\"><span style=\"color: #81A1C1\">function<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{{<\/span><span style=\"color: #D8DEE9\">var_value<\/span><span style=\"color: #ECEFF4\">}}<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n<p class=\"wp-block-paragraph\"><em>Is dit niet de macro die je zocht? Bekijk hieronder verwante macro&#8217;s of <a href=\"https:\/\/upendo.com\/contact\">vraag er een aan<\/a>. <\/em><\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","type_macros_pt":[47],"tag_macros_pt":[46],"level_macros_pt":[45],"class_list":["post-2340","macros_pt","type-macros_pt","status-publish","hentry","type_macros_pt-gegevensmanipulatie","tag_macros_pt-array-nl","level_macros_pt-intermediair"],"acf":[],"_links":{"self":[{"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/macros_pt\/2340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/macros_pt"}],"about":[{"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/types\/macros_pt"}],"author":[{"embeddable":true,"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/users\/2"}],"wp:attachment":[{"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/media?parent=2340"}],"wp:term":[{"taxonomy":"type_macros_pt","embeddable":true,"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/type_macros_pt?post=2340"},{"taxonomy":"tag_macros_pt","embeddable":true,"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/tag_macros_pt?post=2340"},{"taxonomy":"level_macros_pt","embeddable":true,"href":"https:\/\/upendo.com\/nl\/wp-json\/wp\/v2\/level_macros_pt?post=2340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}