{"id":754,"date":"2025-09-21T14:49:23","date_gmt":"2025-09-21T14:49:23","guid":{"rendered":"https:\/\/protolinker.com\/?post_type=docs&#038;p=754"},"modified":"2026-04-01T17:05:46","modified_gmt":"2026-04-01T17:05:46","password":"","slug":"scripts-for-tags","status":"publish","type":"docs","link":"https:\/\/protolinker.com\/pt\/documentation\/scripts-for-tags\/","title":{"rendered":"Scripts para Tags"},"content":{"rendered":"<h2 class=\"wp-block-heading\" id=\"how-to-create-a-script-for-a-tag\">Como criar um script para uma tag<\/h2>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Quando voc\u00ea j\u00e1 possui uma Tag e deseja manipular seus dados, pode adicionar um script para realizar as transforma\u00e7\u00f5es necess\u00e1rias, como converter unidades ou transformar um valor bin\u00e1rio em um valor real. Voc\u00ea pode usar qualquer linguagem de script ou execut\u00e1vel bin\u00e1rio compat\u00edvel com o sistema operacional onde o Protolinker est\u00e1 sendo executado.<\/p>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">O primeiro passo \u00e9 selecionar a tag que voc\u00ea deseja manipular. Para isso, abra a janela de Links, clicando no bot\u00e3o de link no formul\u00e1rio de Configura\u00e7\u00e3o do Protocolo ou no bot\u00e3o Links no canto inferior direito.<br><\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img fetchpriority=\"high\" decoding=\"async\" width=\"527\" height=\"550\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71.png\" alt=\"\" class=\"wp-image-1131\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71.png 527w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71-287x300.png 287w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71-11x12.png 11w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Na se\u00e7\u00e3o Tag Management, selecione o protocolo e a tag \u00e0 qual voc\u00ea deseja adicionar o script e, em seguida, clique no bot\u00e3o Editar.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img decoding=\"async\" width=\"423\" height=\"441\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-72.png\" alt=\"\" class=\"wp-image-1132\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-72.png 423w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-72-288x300.png 288w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-72-12x12.png 12w\" sizes=\"(max-width: 423px) 100vw, 423px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Isso abrir\u00e1 o formul\u00e1rio da Tag, onde voc\u00ea poder\u00e1 alterar sua configura\u00e7\u00e3o, incluindo os scripts. Para configurar o script, basta clicar no bot\u00e3o Configure Script.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img decoding=\"async\" width=\"422\" height=\"441\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-73.png\" alt=\"\" class=\"wp-image-1133\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-73.png 422w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-73-287x300.png 287w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-73-11x12.png 11w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Na janela de Script, voc\u00ea precisar\u00e1 selecionar o caminho do arquivo de script que deseja executar quando a tag alterar seu valor, o comando para execut\u00e1-lo (python, bash ou outro), quaisquer par\u00e2metros extras que o seu script precise para rodar, o timeout (tempo que o script pode executar antes de ser encerrado, para evitar travamentos prolongados) e o tipo de sa\u00edda que ser\u00e1 retornado para a tag como seu novo valor.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"422\" height=\"440\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-74.png\" alt=\"\" class=\"wp-image-1134\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-74.png 422w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-74-288x300.png 288w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-74-12x12.png 12w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Para manter a configura\u00e7\u00e3o, \u00e9 necess\u00e1rio clicar em Salvar em todas as janelas de configura\u00e7\u00e3o. Caso contr\u00e1rio, a configura\u00e7\u00e3o ser\u00e1 perdida.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-remove-a-script-from-a-tag\">Como remover um script da tag<\/h2>\n\n\n<p class=\"wp-block-paragraph\" style=\"\">Quando voc\u00ea n\u00e3o precisar mais de um script, seguir\u00e1 os mesmos passos para criar um, mas agora na janela de configura\u00e7\u00e3o do script, como ele j\u00e1 est\u00e1 configurado, o bot\u00e3o Remover estar\u00e1 habilitado. Portanto, se voc\u00ea clicar nele e salvar a janela de configura\u00e7\u00e3o da tag, a configura\u00e7\u00e3o do script ser\u00e1 exclu\u00edda. Se voc\u00ea cancelar a janela de configura\u00e7\u00e3o da tag, o script continuar\u00e1 na tag.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"629\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-76.png\" alt=\"\" class=\"wp-image-1136\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-76.png 601w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-76-287x300.png 287w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-76-11x12.png 11w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/figure>","protected":false},"excerpt":{"rendered":"<p>How to create a script for a tag Once you have a tag, and you want to manipulate its data you can add a script and make the changes you need to it, like making a unit conversion or transforming a binary number into a real value, for that you can use any script language &hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[17],"doc_tag":[],"class_list":["post-754","docs","type-docs","status-publish","hentry","doc_category-scripts"],"year_month":"2026-07","word_count":316,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"beraldoigor","author_nicename":"beraldoigor","author_url":"https:\/\/protolinker.com\/pt\/author\/beraldoigor\/"},"doc_category_info":[{"term_name":"Scripts","term_url":"https:\/\/protolinker.com\/pt\/docs-category\/scripts\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/docs\/754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/comments?post=754"}],"version-history":[{"count":0,"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/docs\/754\/revisions"}],"wp:attachment":[{"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/media?parent=754"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/doc_category?post=754"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/protolinker.com\/pt\/wp-json\/wp\/v2\/doc_tag?post=754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}