Title: Google Analytics add random clientId
Last modified: January 19, 2022

---

# Google Analytics add random clientId

 *  Resolved [apophis82](https://wordpress.org/support/users/apophis82/)
 * (@apophis82)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-add-random-clientid/)
 * 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](https://wordpress.org/support/users/apophis82/)
 * (@apophis82)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-add-random-clientid/#post-15268042)
 * 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](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-add-random-clientid/#post-15268225)
 * Hi [@apophis82](https://wordpress.org/support/users/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](https://wordpress.org/support/users/aahulsebos/)
 * (@aahulsebos)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-add-random-clientid/#post-15268382)
 * Hi [@jarnovos](https://wordpress.org/support/users/jarnovos/), [@apophis82](https://wordpress.org/support/users/apophis82/),
 * FYI
 * [@apophis82](https://wordpress.org/support/users/apophis82/) proposition is correct
   for 5.*
 * [@jarnovos](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/complianz-gdpr/assets/icon-256x256.png?rev=2881064)
 * [Complianz - GDPR/CCPA Cookie Consent](https://wordpress.org/plugins/complianz-gdpr/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/complianz-gdpr/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/complianz-gdpr/)
 * [Active Topics](https://wordpress.org/support/plugin/complianz-gdpr/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/complianz-gdpr/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/complianz-gdpr/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Aert](https://wordpress.org/support/users/aahulsebos/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/google-analytics-add-random-clientid/#post-15268382)
 * Status: resolved