Alexa Code location

Hi,

Alexa is asking to put the certified code in every page in the header.

I put it in theme -Global custom Javascript

Is it OK?

According to Alexa, they scanned my website and the code is working.
thx

Hi There,

You should add the Alexa verification code under functions.php file locates in your child theme instead:

add_action( 'wp_head', 'print_alexa_script', 999 );
function print_alexa_script(){
	?>
	<meta name="alexaVerifyID" content="ahsgs_kjagsmhgdsjgsdfh" />
	<?php
}

Regards!

Where i insert the ID provided by Alexa?
i tried in fucntions.php ,any alternatives. None are working.
I lost the certification by this code! wrong script.

I put it back in the custom Javascript. Is there a problem with that? Plz note that i am using a multisite Wordpress with subdirectory.

I tried Alexa Plugin on wordpress. I think it works but it is heavy and reduce the speed because:
https://certify-js.alexametrics.com/atrk.js (expiration not specified)

Cannot leverage cache for JS.

Hi there,

What’s the code you’re adding in custom javascript? I think it depends on what code you’re adding. If it’s an embed code then it shouldn’t be added in custom javascript, but functions.php. If it’s pure script then it can’t be just added in functions.php, which should work on custom javascript.

Thanks!

I sent you the code in secure note

Hi @tarekr,

Thanks for the code.

I could see that it could work well. Just don’t forget to confirm your site with Alexa that the code is working well.

You might want to check the thread below. It is the tracking code that you have asked before. You could add the same way.

Hope it helps.

Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.