Adding Google Analytics script to existing files

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Nina Esile
Sr. Propeller Head
Posts: 153
Joined: Tue May 05, 2009 1:07 pm

Adding Google Analytics script to existing files

Post by Nina Esile »

Does anyone know how to add the code for Google Analytics (I have the code) to each of the files in my existing project. I understand that if I had known I was going to add GA script to my files, I could have put it in a template file, but at this point in the game, I have already created my files. Do I have to add the script manually at this point?

Thanks!
kwag_myers
Propellus Maximus
Posts: 810
Joined: Wed Jul 25, 2012 11:36 am
Location: Ann Arbor, MI

Re: Adding Google Analytics script to existing files

Post by kwag_myers »

I haven't worked much with GAs, but if the text is the same on all pages, can you add it to your PageLayout? I think you'd have to do that manually (in NotePad) as Flare doesn't offer the Text Editor with PageLayouts.

If the code must go in each topic, I'd recommend a third-party Search and Replace tool to insert the code before the </body> tag. Search & Replace Master is my choice for this type of task.
"I'm tryin' to think, but nothin' happens!" - Curly Joe Howard
NorthEast
Master Propellus Maximus
Posts: 6410
Joined: Mon Mar 05, 2007 8:33 am

Re: Adding Google Analytics script to existing files

Post by NorthEast »

Add the script to the master page (not page layout) - that will include the script it on each page. (Don't use a search/replace as suggested.)

You can insert the script code in the master page, or add a script link to a file that contains the code.
If you have a script link to a file, it'll make it a lot easier to change in the future.
rpa
Propeller Head
Posts: 36
Joined: Mon Jun 10, 2013 3:47 am
Location: Thurgau, Switzerland
Contact:

Re: Adding Google Analytics script to existing files

Post by rpa »

There was recently an article in the MadCap blog about google analytics, including a description how to insert the script. I did it this way and it worked out fine.

http://www.madcapsoftware.com/blog/2014 ... analytics/
Post Reply