{"id":16552837,"date":"2023-03-13T05:17:57","date_gmt":"2023-03-13T05:17:57","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/get-conversion-path\/"},"modified":"2023-03-13T05:17:57","modified_gmt":"2023-03-13T05:17:57","slug":"get-conversion-path","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/get-conversion-path\/","title":{"rendered":"Get conversion path"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi! I am trying to get the conversion paths for our forms.<br \/>I was able to create a shortcode however it does not contain the path where the user submitted the form.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s my shortcode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function conversion_path_to_crm() {\n\n\u00a0 \u00a0 \u00a0 \u00a0 if (isset($_COOKIE&#091;'_cp'])) {\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $paths = ltrim($_COOKIE&#091;'_cp'], '|');\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if ($paths != '') {\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $paths = explode('|', $paths);\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $sliced = array_slice($paths, -5);\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $final_path = '';\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 foreach ($sliced AS $path) {\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $path = explode(',,', $path);\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $path = $path&#091;0] . ' - ' . $path&#091;1] . '&lt;br\/&gt;';\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $final_path .= $path;\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0return $final_path;\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 add_shortcode('BP_CONVERSION_PATH', 'conversion_path_to_crm'); \u00a0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I hope someone will help me on this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks in advance!<\/p>\n","protected":false},"template":"","class_list":["post-16552837","topic","type-topic","status-publish","hentry","topic-tag-path","topic-tag-shortcode"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16552837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16552837\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16552837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}