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!
Adding Google Analytics script to existing files
-
- Sr. Propeller Head
- Posts: 153
- Joined: Tue May 05, 2009 1:07 pm
-
- Propellus Maximus
- Posts: 810
- Joined: Wed Jul 25, 2012 11:36 am
- Location: Ann Arbor, MI
Re: Adding Google Analytics script to existing files
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.
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
Re: Adding Google Analytics script to existing files
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.
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.
-
- Propeller Head
- Posts: 36
- Joined: Mon Jun 10, 2013 3:47 am
- Location: Thurgau, Switzerland
- Contact:
Re: Adding Google Analytics script to existing files
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/
http://www.madcapsoftware.com/blog/2014 ... analytics/