{"id":1988,"date":"2021-01-15T21:03:27","date_gmt":"2021-01-15T21:03:27","guid":{"rendered":"https:\/\/wiki.pontiac.media\/?page_id=1988"},"modified":"2025-03-24T21:04:54","modified_gmt":"2025-03-24T21:04:54","slug":"function-macros","status":"publish","type":"docs","link":"https:\/\/wiki.pontiac.media\/?docs=new-test-section\/creative-macros-2\/function-macros","title":{"rendered":"Function Macros"},"content":{"rendered":"\n<p>A function macro performs a function on another macro. Function macros can be used in\u00a0combination with any other creative macro, including custom macros although if they are not\u00a0recognized at render time, they will not be translated and the function will not be called.\u00a0<\/p>\n\n\n\n<p>Pontiac currently supports the&nbsp;{$URL_ENC}&nbsp;function macro, which can be used for a variety of&nbsp;&nbsp;purposes related to encoding. A key use case is when a URL needs to be passed from ad server to ad server via a creative macro, and due to the presence of unsupported characters in&nbsp;&nbsp;standard URL formatting, must be encoded at various steps of the process.&nbsp;<\/p>\n\n\n\n<p>The macro takes the following form:&nbsp;<\/p>\n\n\n\n<p>${URL_ENC(${MACRO_NAME},#)}&nbsp;<\/p>\n\n\n\n<p>where\u00a0${MACRO_NAME}\u00a0is the macro to be encoded and # is the integer\u00a01,\u00a02, or\u00a03, representing\u00a0the number of times to encode the contents. Note that more than three encodings are not\u00a0supported.\u00a0\u00a0<\/p>\n\n\n\n<p>Each encoding corresponds to a step in the redirect chain, as well as how a given third-party\u00a0click tracker works with the macro. Double encoding will usually be needed for final destination\u00a0URLs when a second ad server is involved, and triple encoding for a third ad server.\u00a0<\/p>\n\n\n\n<p>To determine whether you will need to use single, double, or triple encoding, you should check with your third-party click tracker and then test your\u00a0URL_ENC\u00a0macro to ensure it works. If your macro is not working, one consequence of this may be link breakage, which will result in users\u00a0 not reaching the intended destination URL.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;<\/h3>\n","protected":false},"author":1,"featured_media":0,"parent":1661,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1988","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/1988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1988"}],"version-history":[{"count":2,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/1988\/revisions"}],"predecessor-version":[{"id":9568,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/1988\/revisions\/9568"}],"up":[{"embeddable":true,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/1661"}],"next":[{"title":"Macro Implementation Recommendations & Examples","link":"https:\/\/wiki.pontiac.media\/?docs=new-test-section\/creative-macros-2\/macro-implementation-recommendations-examples","href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/8517"}],"prev":[{"title":"Privacy Macros","link":"https:\/\/wiki.pontiac.media\/?docs=new-test-section\/creative-macros-2\/privacy-macros","href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=\/wp\/v2\/docs\/9090"}],"wp:attachment":[{"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1988"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/wiki.pontiac.media\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}