Shahi LegalFlowSuite

Analytics Integration

Overview

Analytics Integration connects consent management with popular analytics platforms, enabling privacy-compliant tracking of user consent behavior and website interactions.

Supported Platforms

Google Analytics 4 (GA4)

Integration Features:

    1. Consent event tracking
    2. Privacy-compliant measurement
    3. Consent mode integration
    4. Custom dimension tracking
    5. Events Tracked:

    6. Consent banner displayed
    7. Consent granted/denied
    8. Consent categories selected
    9. Consent withdrawal
    10. Time to consent decision
    11. Custom Dimensions:

    12. Consent status
    13. Consent categories
    14. Geo region
    15. Template variant
    16. A/B test group
    17. Segment

      Integration Features:

    18. Event streaming to Segment
    19. User trait tracking
    20. Consent state management
    21. Destination filtering
    22. Events Sent:

    23. Consent Updated
    24. Banner Interaction
    25. Preference Changed
    26. Withdrawal Completed
    27. User Traits:

    28. Consent status
    29. Consent timestamp
    30. Consent categories
    31. Geo location
    32. Device information
    33. Mixpanel

      Integration Features:

    34. User profile updates
    35. Event tracking with properties
    36. Consent funnel analysis
    37. A/B test tracking
    38. Events Tracked:

    39. Banner Shown
    40. Consent Given
    41. Consent Withdrawn
    42. Category Selected
    43. Time Metrics
    44. User Properties:

    45. Consent level
    46. Consent date
    47. Region
    48. Device type
    49. Browser info
    50. Event Types

      Consent Events

      Banner Events:

    51. consentbannerdisplayed
    52. consentbannerinteraction
    53. consentbannerdismissed
    54. Decision Events:

    55. consent_granted
    56. consent_denied
    57. consent_customized
    58. consent_withdrawn
    59. Category Events:

    60. consentcategoryaccepted
    61. consentcategoryrejected
    62. consentcategoryupdated
    63. Performance Events

      Timing Events:

    64. consenttimeto_decision
    65. consentinteractionduration
    66. bannerloadtime
    67. Engagement Events:

    68. consentpageviews
    69. consentscrolldepth
    70. consentexitintent
    71. Configuration

      Platform Setup

      Google Analytics 4:

    72. Enable GA4 integration in SLOS
    73. Enter GA4 Measurement ID
    74. Configure consent mode
    75. Set up custom dimensions
    76. Test event tracking
    77. Segment:

    78. Enable Segment integration
    79. Enter Segment write key
    80. Configure event mapping
    81. Set up user traits
    82. Test data flow
    83. Mixpanel:

    84. Enable Mixpanel integration
    85. Enter Mixpanel project token
    86. Configure event properties
    87. Set up user profiles
    88. Test tracking
    89. Event Mapping

      Custom Event Names:

    90. Rename default events
    91. Map to existing events
    92. Create event hierarchies
    93. Add event prefixes
    94. Property Configuration:

    95. Include/exclude properties
    96. Rename property keys
    97. Transform property values
    98. Add custom properties
    99. Privacy Compliance

      Consent Mode Integration

      Google Consent Mode:

    100. Respects user consent choices
    101. Modifies tracking behavior
    102. Maintains privacy compliance
    103. Supports regional requirements
    104. Consent States:

    105. Granted: Full tracking
    106. Denied: Limited tracking
    107. Partial: Category-based tracking
    108. Data Minimization

      Property Filtering:

    109. Remove personal identifiers
    110. Anonymize IP addresses
    111. Limit data retention
    112. Aggregate sensitive data
    113. Regional Compliance:

    114. GDPR data processing
    115. CCPA opt-out handling
    116. LGPD consent requirements
    117. PIPEDA compliance
    118. Advanced Features

      A/B Testing Integration

      Variant Tracking:

    119. Track template performance
    120. Measure consent rates
    121. Analyze user behavior
    122. Optimize banner design
    123. Test Configuration:

    124. Define test variants
    125. Set traffic distribution
    126. Configure goals
    127. Monitor results
    128. Custom Events

      Hook-Based Events:

    129. Custom event triggers
    130. Dynamic property injection
    131. Conditional event firing
    132. Event filtering
    133. JavaScript API:
      `javascript
      // Fire custom consent event
      SLOS.consent.trackEvent(‘custom_interaction’, {
      action: ‘button_click’,
      element: ‘privacypolicylink’,
      timestamp: Date.now()
      });
      `

      Reporting & Analytics

      Consent Analytics Dashboard

      Key Metrics:

    134. Consent acceptance rate
    135. Average time to consent
    136. Withdrawal rate by category
    137. Regional consent patterns
    138. Template performance
    139. Conversion Tracking:

    140. Consent impact on conversions
    141. Bounce rate changes
    142. Session duration effects
    143. Goal completion rates
    144. Custom Reports

      Event Analysis:

    145. Event frequency analysis
    146. User journey mapping
    147. Funnel visualization
    148. Cohort analysis
    149. Performance Reports:

    150. Load time impact
    151. Event delivery success
    152. Error rate monitoring
    153. Platform-specific metrics
    154. API Integration

      REST API Endpoints

      Analytics Configuration:
      `
      GET /wp-json/slos/v1/analytics/config
      POST /wp-json/slos/v1/analytics/config
      PUT /wp-json/slos/v1/analytics/platforms/{platform}
      `

      Event Management:
      `
      GET /wp-json/slos/v1/analytics/events
      POST /wp-json/slos/v1/analytics/events/custom
      GET /wp-json/slos/v1/analytics/events/{event_id}
      `

      Webhook Support

      Real-time Events:

    155. Consent events
    156. Platform connection status
    157. Error notifications
    158. Performance alerts
    159. Integration Examples:

    160. Slack notifications
    161. Email alerts
    162. External dashboards
    163. Compliance monitoring
    164. Troubleshooting

      Event Not Tracking

      Common Issues:

    165. Platform credentials incorrect
    166. JavaScript loading issues
    167. Consent mode conflicts
    168. Network connectivity
    169. Solutions:

    170. Verify API keys
    171. Check browser console
    172. Test platform dashboards
    173. Review network requests
    174. Data Not Appearing

      Platform-Specific Issues:

    175. GA4: Check measurement ID
    176. Segment: Verify write key
    177. Mixpanel: Confirm project token
    178. Timing Issues:

    179. Event queuing delays
    180. Batch processing
    181. Platform processing time
    182. Cache clearing
    183. Performance Impact

      Optimization:

    184. Event batching
    185. Asynchronous sending
    186. Error handling
    187. Resource monitoring
    188. Monitoring:

    189. Event success rates
    190. Response times
    191. Error frequencies
    192. Platform limits
    193. Best Practices

      Implementation

    194. Test Thoroughly: Verify all platforms
    195. Monitor Performance: Track impact on site speed
    196. Privacy First: Respect user consent choices
    197. Regular Audits: Review tracking implementation
    198. Compliance

    199. Transparent Tracking: Clear privacy notices
    200. User Control: Easy opt-out mechanisms
    201. Data Minimization: Only necessary data
    202. Legal Compliance: Regional law adherence
    203. Performance

    204. Efficient Tracking: Minimize payload size
    205. Error Handling: Graceful failure modes
    206. Resource Management: Background processing
    207. Monitoring: Performance tracking
    208. Security Considerations

      Data Protection

      Secure Transmission:

    209. HTTPS-only communication
    210. API key encryption
    211. Secure credential storage
    212. Input validation
    213. Access Controls:

    214. Platform permission management
    215. User data isolation
    216. Audit trail logging
    217. Suspicious activity detection
    218. Privacy Safeguards

      Data Handling:

    219. No personal data in analytics
    220. Anonymization techniques
    221. Retention policies
    222. Deletion capabilities
    223. Compliance Monitoring:

    224. Regular privacy audits
    225. Data processing records
    226. User consent verification
    227. Regulatory reporting
    228. Custom Integration

      Third-Party Platforms

      Supported Platforms:

    229. Adobe Analytics
    230. Matomo
    231. Plausible
    232. Custom analytics
    233. Integration Process:

    234. Platform evaluation
    235. API documentation review
    236. Custom code development
    237. Testing and validation
    238. Custom Event Development

      Event Creation:
      `php
      // Hook into consent events
      addaction(‘slosconsentgranted’, ‘customanalytics_event’, 10, 2);
      function customanalyticsevent($consentdata, $userid) {
      // Custom analytics logic
      customanalyticstrack(‘consentgranted’, $consentdata);
      }
      `

      Property Enhancement:
      `php
      // Add custom properties to events
      addfilter(‘slosanalyticseventproperties’, ‘addcustomproperties’, 10, 2);
      function addcustomproperties($properties, $event_name) {
      $properties[‘customfield’] = getcustom_value();
      return $properties;
      }
      `

      Related Documentation

    239. Consent Management Overview
    240. Cookie Banner Templates
    241. Consent Tracking
    242. Regional Compliance
    243. Configuration Guide

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket