Skip to content

Commit

Permalink
Create identify component
Browse files Browse the repository at this point in the history
  • Loading branch information
marlocorridor committed Aug 14, 2024
1 parent 663433a commit 453e939
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions resources/views/components/identify.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@props([
'enabled' => true,
'user' => null,
'custom_session_id' => null,
'custom_page_id' => null,
])

@if ($enabled && config('clarity.enabled') && config('clarity.enabled_identify_api'))
<script type="text/javascript">
(function(){
window.clarity(
"identify",
@if($user?->email) "{{$user->email}}" @else null @endif,
@if($custom_session_id) "{{$custom_session_id}}" @else null @endif,
@if($custom_page_id) "{{$custom_page_id}}" @else null @endif,
@if($user?->name) "{{$user->name}}" @else null @endif,
);
})();
</script>
@endif

0 comments on commit 453e939

Please sign in to comment.