Skip to content

QUESTION: wait for consent before tracking? #243

@Timon-D3v

Description

@Timon-D3v

Hey there, quick question

How can i tell tinji to wait for tracking until the user gave consent? Like for google analytics there is the consent tag and you can give it an object like this:

            window.dataLayer = window.dataLayer || [];
            function gtag() {
                window.dataLayer.push(arguments);
            }
            
            // set defualt consent mode like this
            gtag("consent", "default", {
                ad_storage: "denied",
                analytics_storage: "denied",
                personalization_storage: "denied",
                functionality_storage: "granted",
                security_storage: "granted",
            });

            // update like this
            document.addEventListener("cookie_consent_updated", () => {
                gtag("consent", "update", {
                  ad_storage: "denied",
                  analytics_storage: "denied",
                  personalization_storage: "denied",
                  functionality_storage: "granted",
                  security_storage: "granted",
              });
            });

Is there already a feature like this? I could not find anything in the docs.

If there is no such feature yet. Would you be interested in such a feature. I would love to contribute as well.

Cheers
Timon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions