Inserting google analytics script for a single page

We have got the google analytic script that should be inserted to the page that requires statistics to be captured in GA. We don't want to insert this script in confluence 'Custom HTML' as this will be effective for all the instance. We just want to capture the statistic of a single space. Please note that the space already have some 50 page and I could not go and edit all those 50 page and insert the script for the pages.

# Can I modify the page layout of the space and insert the script so that all the pages have this script as the first content of the page?

# If we can implement point 1, then will that be effective for older pages as well or will that be applicable only for the new pages added.

# If point 1 can not be done, can you please suggest an alternate method to do so?

There is an option to use page template(containing the script) for any new page created, but again this will be not effective as we already have some 50 pages created.

Best Regards,

Nawaz Quadri

1 answer

0 vote
David Simpson Community Champion Feb 13, 2013

Create a user macro containing the GA specific Javascript.

If the space uses the Documentation theme, add the user macro to the header or footer. If not, add the user macro to every page.

Alternatively, if using the default theme, start messing with the Layoputs for that space.

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

389 views 6 16
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot