Jump to content

Adding Google Analytics and Ad Roll? New to PW


johppann
 Share

Recommended Posts

39 minutes ago, johppann said:

I am new to PW and have a client who use it for their website. I am trying to figure out where do I place the GA code and Ad Roll code in PW? Any help would be appreciated.

Hi John and welcome to PW!

To expand on what Tom said, you might be looking for a head.php template file, or perhaps it will be in main.php or something along those lines. PW doesn't control your frontend markup at all, so there is no way to know for certain how the previous developer set things up, but what you are looking for a a template file that is included in all the page specific template files, or one that itself includes the other ones.

  • Like 3
Link to comment
Share on other sites

36 minutes ago, Macrura said:

usually you put google analytics in the footer since it is a script tag

 

In this case, Google recommends just in the head, or after the opening body tag:

Quote

 

In practice, the Google Analytics code will work regardless of where you put it on the page. We recommend inserting it in the <head> section or after the opening <body> tag if possible. This is because the higher up it is inserted in your page source code, the sooner it will get executed after the user lands on your page. If you put your Analytics tracking code at the bottom of your code, it will be the last piece of script to get executed. Sometimes, if the user navigates to another page before the page has finished loading, the tag may not have time to fire and the data you collect will be less accurate. That's why the best practice is to put the tag towards the top of your page code. 

Also - keep in mind that the tag is designed to work asynchronously, therefore, it will have no impact on your page load time.
Hope that clarifies the issue.
 
Lothaire from the Google Analytics Academy Staff

 

 
 
Quote

Paste your tracking code snippet into its own include file, then include it in your page header, so that the snippet appears before the closing </head> tag on every web page on your site you wish to track.

  • Like 4
Link to comment
Share on other sites

thanks for correcting me; i was going by what I've seen on the majority of sites, as well as the HTML5 boilerplate, so i was blindly following the crowd, and i think google changed their instructions at some point also.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...