{"id":12522953,"date":"2020-03-09T09:08:36","date_gmt":"2020-03-09T09:08:36","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/interstitial-javascript-redirect-with-redirection\/"},"modified":"2020-03-09T09:08:36","modified_gmt":"2020-03-09T09:08:36","slug":"interstitial-javascript-redirect-with-redirection","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/interstitial-javascript-redirect-with-redirection\/","title":{"rendered":"Interstitial JavaScript Redirect with Redirection"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I created this GIST because I wanted to load some javascript before redirecting so I could track visitors via Facebook Pixel, Mautic, Google Analytics etc etc.<\/p>\n<p>If your site outputs those tracking codes in the header or footer then you just need to change the redirect from server-side to javascript on the client-side and probably wait 3 or so seconds for the js to load.  So that is what I have done with the GIST below.  <\/p>\n<p>If the author of the plugin is interested in having this in the core codebase I can add a field for which page to use and a new redirect type that inherits WordPress redirect type.  IF not I may try and find time to make a plugin for it.  Either way only if anyone is interested.  Thanks!<\/p>\n<p>https:\/\/gist.github.com\/weismannweb\/f1febe71e9f638d7d31464247d357961<\/p>\n","protected":false},"template":"","class_list":["post-12522953","topic","type-topic","status-publish","hentry","topic-tag-interstitial","topic-tag-tracking-codes"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12522953","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\/12522953\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12522953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}