Hi,
I know how to add code snippets to the template of any given page, but would like to know how i can add a code snippet to a master template, so that the code is reproduced in the footer of every single page of the site. Code is integration code for an affiliate program.
Any easy way to do this? Don't want to past to 100 pages manually.
Thanks.
As Tim Wayne indicated, any code that should be included in all pages of your website should be included in the appropriate theme file of your site. These files can be accessed when you are using a Custom Theme. You can begin a Custom Theme based on any Stock Theme.
Pages within your nation pull code from a variety of places, beginning with the theme files. The video included in our Theme Documentation helps explain this process.
From your discussion in the comment section, it sounds like the Google analytics code you placed is not complete. Be sure it is in this format: UA-2839551-10. The code you place should include as many digits as included in this format example.
Showing 9 reactions
Sign in with
RB
I checked as per your instructions (love to learn new skills) and the script is indeed showing up in the source code with the web property ID, so that’s fine.
Reason I was concerned, is that the Google Analytics page actually records a specific time down to the milisecond, when it last checked the site for the code. Everytime i REFRESH the google analytics page, that time stamp changes to the time of the refresh, leading me to believe that when i refresh the page, it was forcing Google to run another check of the site for the code.
From what you have said, that is not necessarily the case. I guess i’ll wait a couple of days and see if the status changes. Maybe I should log out and then log back in, didn’t think of that either.
Thanks again for your help.
Robin
Tim Wayne
Certified Architect
Certified Expert
So, you entered the UA number in the NationBuilder CRM. Did you verify that the code is or is not showing up? Go to your live site again, view source, and search (cntrl-F or cmmd-F) for your UA number.
If you DO indeed see it on there but Google is saying it isn’t there, then what’s likely the issue is that you have to wait a day or two for Google to index your pages again.
If you DO NOT see your UA number on the page anywhere, then that’s a more serious issue and you should maybe open another ticket for that.
-Tim
Was able to verify that it’s there… thanks. It’s the integration code for an affiliate program.
SECONDLY, I have already attempted to add Google Analytics via the dashboard as prescribed. However, back in my Google Analytics account, it still says: “Status: Tracking Not Installed”
Google provides a full SCRIPT which includes the web property ID, but NB analytics setup module asks you to enter ONLY the ID, not the full script. Can you tell me why it’s not registering in my analytics account as installed, if it is really supposed to work with just the web property ID entered on NB?
Thanks Tim.
Tim Wayne
Certified Architect
Certified Expert
If it’s on layout.html, then it’s on every page. To verify that it’s on every page, view your site live on your browser, then view source and look for your script. Try it on a few pages.
What kinda script are you adding? If it’s a Google Analytics code, there’s an even easier way to add it to your site than the layout.html file: http://nationbuilder.com/how_can_i_add_google_apps_and_webmaster_tools_to_my_nation
I’m not a coder, so forgive my ignorance if it’s not meant to be visible in the html of all other pages. Just want to make sure it’s good to go.
Please confirm?
Thanks.
Tim Wayne
Certified Architect
Certified Expert
Go to Pages > Theme > layout.html (down in the file list).
If it’s in the layout.html file, it will appear on every page of the site (except for your splash page).