hs-script with wp rocket and moving to header

pozitronic
Member

Hi,

 

Sometimes the hubspot hs-script appears to not capture:

  • original source
  • first referring site
  • first seen etc.

I think this could be because of two problems:

 

  1. The code is not in the header
  2. wp-rocket is doing something to it.

How can I move the code to the header, when Hubspot appears to insert it site wide into the body.

 

Any ideas?

 

And how can I prevent Wp Rocket from doing it's magic to this plugin.

 

Any ideas?

0 Upvotes
1 Accepted solution
Ben_M
Solution
Key Advisor

What plugin are you using? That was my initial question. Is it a plugin managing tags for you?

 

If you referring to the Hubspot wordpress plugin that is absolutely unnecessary and just for people who don't take the next steps to move towards a tag manager like GTM. So you could easily remove it, switch over and solve this.

View solution in original post

4 Replies 4
Ben_M
Key Advisor

What are you doing to put the code on the body?  It should be inserted into the head of your document. Personally speaking I usually recommend the use of a tag manager like Google Tag Manager to fire your scripts and control them.

pozitronic
Member
Agreed! It should be in the head! But the plug-in automatically inserts it
in Feb body! Very bizarre. And because the plug-in inserts it on my behalf
on every page automatically I can’t just remove the code easily from every
pave without a headache 😕
0 Upvotes
pozitronic
Member

I agree with you, it should actually put the code into the head. That's why I said "I think this is the problem..."

 

Unfortunately the plugin inserts the code into the body. I would use tag manager, but as I'm using the wordpress plugin, it automatically inserts the code into the body.

 

But thank you so much for your feedback!

0 Upvotes
Ben_M
Solution
Key Advisor

What plugin are you using? That was my initial question. Is it a plugin managing tags for you?

 

If you referring to the Hubspot wordpress plugin that is absolutely unnecessary and just for people who don't take the next steps to move towards a tag manager like GTM. So you could easily remove it, switch over and solve this.