Embed Salesmanago code into a Grav website


Hi there,
Does anyone here know the easiest and best way to embed Salesmanago code into a Grav website.

Together with the Script I got the following description from Salesmanago:

“To implement your code just copy and paste it into your website’s source code,
before the end of section”

Any ideas?


Hi @gaatec, in general this code (JavaScript I am assuming) could be added to one of the Twig files of your current theme. In order to not get this possibly removed when a theme update happens you should first make an inherited theme: https://learn.getgrav.org/themes/customization#theme-inheritance

If you provide the name of the theme you are using I might be able to give you more specific info.


Hi there, and thanks a lot for replying.
I am using the Clean Blog v1.4.2 theme

Best Reg.


Are you trying to add a contact form within an iframe? If so, you should be able to do this by editing the template file contact.html.twig within the folder user/themes/clean-blog/templates/.

In the above file look for this:

    <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        {{ page.content }}
        {% include "forms/form.html.twig" with { forms: "contact-form" } %}

And try to replace the code between the two div tags with your SALESmanago iframe code:

    <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <iframe src=""></iframe>


Hi again,
I simply want to add the Salesmanago code to every page, so that Salesmanago can track the visits, etc.

In the Salesmanago description, they ask me to add the code before the end of the /body section.
The code is indeed Javascript.


Ah, a-ok for that you could want to add the JavaScript to the base.html.twig file in the folder `user/themes/clean-blog/templates/partials’

There, scroll down until you see this…

        {% block bottom %}
        {{ assets.js() }}
    {% endblock %}

Then add your JavaScipt just before the end of body tag, like this:

        {% block bottom %}
        {{ assets.js() }}
    {% endblock %}



Let me know if that works for you.


Will give it a try and let you know how it work.

Thanks a lot Paul, highly appreciated.



Hi again Paul,
Your suggestion did indeed sort this out for me.

Thanks a lot, couldn’t have done this without your help.