Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Einbindung Trustami Widget #202

Closed
Shoekrates opened this issue Apr 15, 2024 · 3 comments
Closed

Einbindung Trustami Widget #202

Shoekrates opened this issue Apr 15, 2024 · 3 comments
Labels
duplicate This issue or pull request already exists invalid This doesn't seem right not a bug not a bug

Comments

@Shoekrates
Copy link

Hallo!
Ich verzweifle an der Einbindung eines Trustami Widgets. Der eigentliche Code zur Einbindung lautet:

<script id="trustamiwidget" type="text/javascript" src=https://cdn.trustami.com/widgetapi/widget2/trustami-widget.js data-profile="xxxxxxxxxxxxxxxxxxxx" data-user="zzzzzzzzzzzzzzzzzzzzz" data-platform="0" async></script>

Wenn ich das als benutzerdefiniertes Skript einbinde, wie kann ich die data-Attribute zusätzlich anfügen? Oder gibt es andere sinnvolle Methoden für die Einbindung?

@doishub
Copy link
Member

doishub commented Apr 15, 2024

In diesem Fall würde ich die addModule-Methode nutzen und das Skript-Tag selber aufbauen.

@zoglo zoglo added not a bug not a bug invalid This doesn't seem right labels Apr 15, 2024
@zoglo zoglo closed this as completed Apr 15, 2024
@zoglo zoglo added the duplicate This issue or pull request already exists label Apr 15, 2024
@Shoekrates
Copy link
Author

Shoekrates commented Apr 16, 2024

Lieben Dank euch beiden. Manchmal braucht man nur einen Anstupser. Und mit den ganzen erklärenden Links habe ich es dann tatsächlich geschafft.
Als Cookie-Typ habe ich den Hinweis gewählt, darüber bekomme ich die notwendige ID.
Mein Code, falls es nochmal jemand braucht:

document.addEventListener("DOMContentLoaded", function() {
     cookiebar.addModule(7, function() {
	  let script = document.createElement('script');
	  script.type = 'text/javascript';
          script.setAttribute('data-profile', 'xxxxxxxxxxxxxxxxxxxxxxxxxxx');
          script.setAttribute('data-user', 'zzzzzzzzzzzzzzzzzzzzzzzz');
          script.setAttribute('data-platform', '0');     
	  script.src = 'https://cdn.trustami.com/widgetapi/widget2/trustami-widget.js';
    	 document.head.append(script);
     });
});

@zoglo zoglo removed duplicate This issue or pull request already exists invalid This doesn't seem right not a bug not a bug labels Jan 8, 2025
@oveleon oveleon locked and limited conversation to collaborators Jan 8, 2025
@zoglo zoglo converted this issue into discussion #248 Jan 8, 2025
@zoglo zoglo added duplicate This issue or pull request already exists invalid This doesn't seem right not a bug not a bug labels Jan 8, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
duplicate This issue or pull request already exists invalid This doesn't seem right not a bug not a bug
Projects
None yet
Development

No branches or pull requests

3 participants