Title: Insert Alexa Code in Customizr
Last modified: August 21, 2016

---

# Insert Alexa Code in Customizr

 *  [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/)
 * Hi,
 * I need to drop in Alexa’s code to track my website for traffic. The code needs
   to be inserted below the <body> tag. I need to know how do this on the front 
   page of Customizr. I do not want to create a new page for the front page – I’m
   using the front page with sliders, blog posts that already preset. Please advise
   ASAP. Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981723)
 * The <body> tag is loaded in customizr/header.php.
 * I’ve looked up Alexa & can’t see the code needed, but I assume you could add 
   it after the main-wrapper <div> on line 46.
 * Would recommend you keep a copy of any new code as Theme files will be replaced
   with each new update of Customizr.
 *  Thread Starter [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981728)
 * The code is given when you sign up for their site – this should be inserted on
   every page, however I just want it on the front page of the site. Their instructions
   indicate it should go after the <body> tag. I don’t know where line 46 is on 
   the front page that you are referring. Since this author doesn’t provide the 
   CSS to edit that is an issue.
 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981734)
 * What you’ve got here is Javascript, not CSS. (fyi, the Customizr CSS is found
   in customizr/inc/css/*.css).
 * You need to edit the file customizr/header.php and add your code at the end, 
   after line 46.
 * I’m not a Javascript expert, but try that first.
 * Seems unusual not to include Javascript in either the <header> or <footer>, but
   if that’s what they’re telling you to do then what do I know 😉
 *  Thread Starter [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981738)
 * Thanks. I went to the CSS editor – there is no code there. In the latest update
   there is nothing in the editor to use. I’ve used Firefox as well to review it
   and that doesn’t make the code stick in the customizr editor as well. Generally,
   I’ve had to come here to get a code fix. This script just need to be inserted
   into the code for the page. It works on other sites I manage for clients but 
   those authors provide the CSS to edit. This author does not .
 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981745)
 * The CSS editor is there to help you amend the core CSS, which is found in customizr/
   inc/css/*.css files.
 * But again, you have a Javascript issue, not a CSS issue.
 * (Your post with Javascript has been removed, I presume by a Moderator for some
   reason.)
 * Send me that Javascript code to _[Redacted – Please keep support on these forums]_.
   I’ll send you back a new header.php file to replace your current one.
 * I can’t guarantee it will work but I’m willing to try to help you out.
 *  Thread Starter [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981750)
 * Thanks, Dave. I’ll send you the code. Appreciate the assist
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981751)
 * We recommend using [PasteBin](http://pastebin.com) to share code.
    _[http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)_
 *  Theme Author [presscustomizr](https://wordpress.org/support/users/nikeo/)
 * (@nikeo)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981755)
 * Hi Jolney,
    Usually, this kind of code has to be inserted in the <head> section
   of the page. Here is a code that you can copy in you functions.php file to insert
   your alexa code only in the front page :
 *     ```
       add_action('wp_head', 'alexa_code_function');
   
       //you can use the following to insert it after <body> tag
       //add_action('before_menu','alexa_code_function');
   
       function alexa_code_function() {
       if( is_front_page() || is_home() ) { ?>
       /*YOUR ALEXA CODE HERE*/
       <?php }
       }
       ```
   
 * Hope this helps,
    Nicolas
 *  Thread Starter [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981756)
 * Andrew, I appreciate it. Generally when I’ve asked questions here, Nikeo responds
   pretty quickly. This is a simple code issue. Dave was kind of enough to respond.
   It would be great if the Editor in Customizr was included with theme so that 
   it could edited easily. I understand the author’s point. However, with this update
   I just need to track my traffic on this site and I just need to insert this script.
   Thanks.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981757)
 * [@jolney](https://wordpress.org/support/users/jolney/) – Threads turn into resources
   for the greater community. If those threads refer to a resource that is only 
   available via email of a particular person then the community misses out.
 * I’m not sure what the issue is here with Pastebin, PasteBin is easier and safer
   than email for me.
 *  Thread Starter [jolney](https://wordpress.org/support/users/jolney/)
 * (@jolney)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981763)
 * I appreciate it Nicolas. Thanks so much.
 * Andrew – completely understand.
 *  [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * (@rdellconsulting)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981771)
 * [@andrew](https://wordpress.org/support/users/andrew/), I understand too. No 
   consolation, but I would have shared the solution here anyway.
 * Nic’s solution is much smarter than mine so all’s well!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Insert Alexa Code in Customizr’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

 * 12 replies
 * 4 participants
 * Last reply from: [rdellconsulting](https://wordpress.org/support/users/rdellconsulting/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/insert-alexa-code-in-customizr/#post-3981771)
 * Status: not resolved