3 Replies Latest reply on Mar 13, 2018 2:14 AM by Sanford Whiteman

    ... transferring discussion from Whisperer Blog on Custom Activities

    Sanford Whiteman

      Moving the discussion on Custom Activities in Marketo here to Products as the other place doesn't have a syntax highlighter.


      Francesco as I was saying, even if your pages use the pathname for the search terms, we can transfer them into the query string (this will be cosmetic from the standpoint of the search engine, but Munchkin will log it for us) to take more intelligent action on the Marketo server.


      Using this code, you'll end up with a Visit Web Page hit to /transferred-search-terms with {{trigger.Search Query}} available for use:


        var transferLoc = document.createElement('a'), 
        transferLoc.href = loc.href; 
        if( pathParts = transferLoc.pathname.match(/\/search\/node\/(.*)/) ){ 
          transferLoc.search = "s=" + pathParts[1]; 
          history.replaceState({}, null, transferLoc.href); 
          Munchkin.munchkinFunction( "visitWebPage", { url : "/transferred-search-terms" });