We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I feel like all I’m doing lately is asking questions. Sorry about that!

    I’ve built a newsletter-style site that requires registration (I’m using WebLoginPE), and the client would like to track completed registrations as Goal Conversions in Google Analytics. I’m using the "instant" method for registration; i.e., after entering registration info, the user is automatically authorized and can log in to view the site. However, because the URL doesn’t change after you register, I need a way to "capture" the registration-submission process as a hit.

    I’ve discovered the excellent Google Analytics plugin (http://modxcms.com/extras.html?view=package/view&package=178), which has the "Alternative Tracking Names" paramter built in. This is exactly what I need, but I’m not sure what I need to put into the "Template Variable name" or "Placeholder name" to get it to work. Can anyone walk me through this? I’m so close, yet so far away!

    Thanks.
    • You can force the page to change after a successful registration using WebLoginPE... simply set the &regSuccessId (and the &regSuccessPause) parameters on your registration page. The target id of regSuccessId will be the page that you can track in GoogleAnalytics to measure successful conversions.

      See the Wiki articles I’ve been working on:
      http://wiki.modxcms.com/index.php/WebLoginPE_Examples

      Be sure to check out the WebLoginPE category for the other related pages.
      • Thanks! This might be what I end up doing. The login is in a sidebar on a coupld of different pages, so ideally, I’d like to not even mess with the success page and keep them in the same spot. But if tracking is what the client needs and I can’t figure out the alternative method in the Google Analytics plugin, this will have to do.
        • For what it’s worth, the solution I outlined is a lot easier than the alternative...
          if you really want to stay on the same page, you’d have to read through the $_POST array and trigger a page reload and place the GA code when the page reloads (maybe you can tap into WebLoginPE’s page reload... but you’d probably have to hack the WebLoginPE snippet). I did that for one form that was a multi-page form compressed into a single page, and it was far more trouble than it was worth. Just put your links and messaging on the registration-success page. Your users won’t notice much of a difference, but your reporting sure will.

          The only other alternative I can think of (which is completely untested) is somehow tapping into WebLoginPE’s taconite option... this allows you to do AJAX calls based on events. Maybe you could launch the GA code via an AJAX call... but since the hows/whys of using the taconite option in WebLoginPE are undocumented, it’s probably not a good option for you... if you DO want to try this, please please please update the wiki!
          • That’s wayyyy over my head. I think I’ll stick with the sucess page! I thought it would be much easier from reading the GoogleAnalytics plugin documentation, but if it’s that complicated, I’ll gladly settle for the extra page.