2 Replies Latest reply on Jun 14, 2016 8:30 AM by Autumn Mahoney

    How to generate anonymous pop-up form

    Lauren Rutledge

      I would like to generate a pop-up contact us form on our website (non-Marketo site) based on an anonymous user's engagement score (calculated based on page visits & asset downloads). I believe I have the program built properly on the Marketo side but my AEM developers are not clear on what kind of API call needs to be implemented to identify the business rules for serving up the form (which are defined in a Smart Campaign). Has anyone deployed a form like this before?

        • Re: How to generate anonymous pop-up form
          Sanford Whiteman

          Lauren, to architect something like this properly (at so-called "web scale") use your business rules to fire a webhook when the lead has met the criteria for an Interesting Moment.  The webhook would update a separate, narrowly focused data store, cross-domain queryable via JavaScript, that is optimized to deal with potentially millions of API calls per day for anonymous leads.


          To be clear, it's possible to query the Marketo database directly for lead data.  And if you were doing this one time per browser session, I'd say it'd be no problem (in this case you could just write the field right onto the lead when the business rules matched, then popup the form using JS when showForm=='yes').  But if you are literally checking on every page view this wouldn't give you acceptable performance as you'd always have to wait for the Marketo servers to return the latest, uncached information. This would end up being the slowest part of your page, and though you could wait for it in the background (asynchronously) you might still be talking about full seconds in a wait state.


          A perhaps larger issue to consider is delayed back-end updates.  When Munchkin logs a page visit or click, there's no guarantee (actually there's more like an anti-guarantee) that on the very next action, the Marketo back end has completely written the earlier action and it's been passed through your Smart Campaign.  This isn't a Marketo-only problem: it's the same for any analytics service that tracks your page view with a lightweight JS call but then passes it through a heavierweight workflow engine deeper within the system.  Sure, the workflow process might just take a couple of seconds -- but within those couple of seconds, the lead may have gone to a new page. If you're lagging slightly behind the lead's last action, by the time you know they're ready to see the form they may have left the site.


          As an alternative, I don't know how complex your SC rules are, but since (by definition) they can only fire based on web traffic patterns within a single browser session, why not just check those rules in JavaScript using cookies, LocalStorage, and/or the History API?

          1 of 1 people found this helpful
          • Re: How to generate anonymous pop-up form
            Autumn Mahoney

            Lauren - were you able to successfully implement this idea? Did you need an outside service at all?