• Resolved apophis82

    (@apophis82)


    Hi!

    It is possible to set the clientId for google analytics with a random generated id?

    I have a script which creates the ID but i don’t know if i could set it via the complianz script.

    ga('create', 'UA-XXXXX-Y', {
      'clientId': randomClientId
    });

    randomClientId is a variable created by a javascript function.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter apophis82

    (@apophis82)

    Can i add the google analytics myself and use
    <script class="cmplz-script" type="text/plain" ....

    Is this automatically added to the marketing category?

    Plugin Contributor Jarno Vos

    (@jarnovos)

    Hi @apophis82,

    Please try one of the below classes to place your script, which will tell the plugin on what consent category it should unblock the script:

    // Functional
    <script type="text/javascript" data-category="functional"></script>
    // Preferences
    <script type="text/javascript" data-category="preferences"></script>
    // Statistics
    <script type="text/plain" data-category="statistics"></script>
    // Marketing
    <script type="text/plain" data-category="marketing"></script>

    Kind regards,
    Jarno

    Plugin Author Aert

    (@aahulsebos)

    Hi @jarnovos, @apophis82,

    FYI

    @apophis82 proposition is correct for 5.*

    @jarnovos suggestion is conform 6+

    regards Aert

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Google Analytics add random clientId’ is closed to new replies.