Custom HTML position

Hello,

I’m new to Matomo, I’ve created a Custom HTML tag and it’s working. I’m using it to control the client’s ads tags. However the Position field (Define the position of where the HTML should be inserted into your website.) only has 4 predefined positions:

  1. Head Start
  2. Head End
  3. Body Start
  4. Body End

Is there a way to pick where exactly in the Body section to insert the tag? similar to the Google One Tag, which has a page preview that you can use to know where exactly the tag should be placed.

Thank you!

Hi,

As the Custom HTML tag is mostly intended for adding a <script> Tag there should never be the need to place anything somewhere else.

If you need to modify the content of the page (e.g. add a <div> somewhere in the middle), you can simply write a <script> tag at the end of the body that includes Javascript that creates this div at any location you need.

1 Like

Hello,

Thank you for the fast reply! and yes this is exactly what we are looking for, for this Ad script tag to be replaced with a <div> for example at a certain place inside the body.
To be honest I’m not much into technicalities I will try to contact the technical team we work with regarding this, is there an example/tutorial/document to follow?

Thanks you!

Do you found any specific solution for that?

I did follow @Lukas advice to create my own script which I insert at the Body End, this script will then place my Tag in certain place on the page.

I’ve marked his answer as a solution: https://forum.matomo.org/t/custom-html-position/40382/2?u=talal