-
AuthorPosts
-
March 24, 2022 at 11:44 am #1345848
Hello dear team, I have to embed an HTML code in the <head> area of my website for my cookie settings. The website (Erecht24) where the code was generated describes the process as follows:
Um Ihre Dienste nur nach Einwilligung Ihrer Website-Besucher auszuspielen, müssen Sie zuerst den HTML-Code für das Usercentrics-Script in Ihre Website integrieren. Wenn Sie den o.a. Generator durchlaufen haben, erhalten Sie abschließend im Feld Script-Tag für Ihre Website ein Stück HTML-Code, welches wie folgt aussieht:
<script type=”application/javascript” src=”https://app.usercentrics.eu/latest/main.js” id=”XXXXXXXXX”></script>
Anstelle von “XXXXXXXXX” finden Sie Ihre persönliche Settings-ID.
Diesen HTML-Code kopieren Sie in Ihre Zwischenablage und fügen ihn anschließend in den <head>-Bereich des HTML-Quellcodes Ihrer Website ein, damit die Usercentrics Consent Management Platform (CMP) auf Ihrer Website aufgerufen wird.
Wichtig: Stellen Sie sicher, dass der HTML-Code für das Usercentrics-Script in jeder Seite Ihrer Website integriert ist, denn Besucher müssen – egal auf welcher Seite sie Ihren Webauftritt betreten – an jeder Stelle die Möglichkeit haben zunächst die Cookie-Einwilligung zu durchlaufen.
Achtung: Die folgenden Elemente müssen vor allen anderen Skripen im header eingefügt werden und dürfen nicht asynchron geladen werden!2. Fügen Sie anschließend diese Tags Ihrem HTML-Header vor allen anderen Scripten hinzu:
Usercentrics Consent Management Platform (CMP V1):
<script type=”application/javascript” src=”https://app.usercentrics.eu/latest/main.js” id=”[IHRE_ID]”></script>Smart Data Protector Script:
<script type=”application/javascript” src=”https://privacy-proxy.usercentrics.eu/latest/uc-block.bundle.js”></script>Für eine Verbesserte Performance empfehlen wir Ihnen diese beiden Zeilen ganz oben in ihrem <head> Bereich einzufügen:
<link rel=”preconnect” href=”//privacy-proxy.usercentrics.eu”>
<link rel=”preload” href=”//privacy-proxy.usercentrics.eu/latest/uc-block.bundle.js” as=”script”>However, I can’t find a way to include the code in this area. when i add a code block in the frontend editor to each page i’m not sure if the cookies are really only activated if the user agrees. With the code block on the landing page, I don’t think it’s in the head area.
I also tried to include the code in header.php under: /home/www/spreewald-luftaufnahme.de/wp-content/themes/enfold/
but that didn’t work either. It is also important that the code is preserved when an update comes.
Can you tell me where I have to embed the code to make it work?
Thanks! – Noel
March 24, 2022 at 11:54 am #1345850This reply has been marked as private.March 24, 2022 at 6:00 pm #1345901Hi,
Please try this in your functions.php file:
function noellmn_add_erecht24_code() { ?> YOUR SCRIPT GOES HERE <?php } add_action('wp_head', 'noellmn_add_erecht24_code');
Please add the code to a child theme, otherwise it will be overwritten on updates.
Best regards,
RikardMarch 24, 2022 at 6:26 pm #1345906Hello,
But the problem is, as soon as I activate the child theme, all design changes will be deleted from the normal theme. So the website is empty.Thanks.
March 24, 2022 at 6:30 pm #1345907* Only when I reactivate the normal theme will the content be back. What solution is there?
March 25, 2022 at 4:17 pm #1346031Hi,
I’m not sure I understand the problem, are you saying that you lose all the content from your site if you activate the child? If you are only missing the styling from the parent, then you can import the settings under Enfold->Import/Export->Import Settings From Your Parent Theme.
Best regards,
RikardMarch 30, 2022 at 1:28 pm #1346571Hello Rikard,
Unfortunately it did not work. The child theme could be successfully activated and the style was also imported. Then I put the code in the functions.php. added that didn’t work.Thanks
March 30, 2022 at 5:09 pm #1346621March 30, 2022 at 5:36 pm #1346629Hi,
thank you, it is working!March 31, 2022 at 12:51 am #1346669Hi,
Glad Rikard could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Include HTML code in’ is closed to new replies.