Skip to main content
Participant
June 1, 2022
Question

How to add google analytics script to ColdFusion

  • June 1, 2022
  • 1 reply
  • 480 views

Hi,

 

I need to set up analytics to get current site page visits. How do I set it up on Coldfusion?

 

Thanks!

    This topic has been closed for replies.

    1 reply

    Charlie Arehart
    Community Expert
    Community Expert
    June 1, 2022

    Well, using GA is mainly  about setting up just a couple lines of html which call Javascript provided by Google. There's really nothing cf-specific about it.

     

    That said, since you'd likely want the js to be on every page. Assuming you create traditional cfml apps and no particular framework, the easiest way to include any code on all pages is via the application.cfm or onrequestend.cfm (old school) or the onrequestendstart/onrequest/onrequestend methods of application.cfc (newer school).

     

    If that may be enough for you to run with, great. If not, let us know where you may need more clarification. 

    /Charlie (troubleshooter, carehart. org)