-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ga analytics qr code click support #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b559840
f080782
42dbc31
e0996b1
28fcad7
5889457
a805789
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,20 @@ export const DocumentStatus = ({ id, title, statuses, selectedSchema, onStatusCl | |
| <DialogTrigger asChild> | ||
| <div | ||
| className="inline-flex items-center justify-center p-2 rounded-xl border border-[#e2e3e7] cursor-pointer" | ||
| onClick={() => | ||
| onClick={() => { | ||
| sendGAEvent({ | ||
| event: 'document_qr_click', | ||
| document_qr_title: title, | ||
| document_qr_schema: selectedSchema, | ||
| document_qr_status: status.label, | ||
| }); | ||
|
Comment on lines
+25
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainNormalize analytics payload keys with existing link click event The link below uses - sendGAEvent({
- event: 'document_qr_click',
- document_qr_title: title,
- document_qr_schema: selectedSchema,
- document_qr_status: status.label,
- });
+ sendGAEvent({
+ event: 'document_qr_click',
+ document_title: title,
+ document_schema: selectedSchema,
+ document_status: status.label,
+ document_id: id,
+ });Please confirm GTM mappings expect these field names and that 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Searching for sendGAEvent usages ==="
rg -n --hidden --no-ignore "sendGAEvent" -S || true
echo
echo "=== Searching for GADataLayerEvent type/usage ==="
rg -n --hidden --no-ignore "GADataLayerEvent" -S || true
echo
echo "=== Searching for document_* analytics keys (document_title, document_schema, document_status, document_qr_*, document_id) ==="
rg -n --hidden --no-ignore "document_title|document_schema|document_status|document_qr_title|document_qr_schema|document_qr_status|document_qr_click|document_id" -S || true
echo
echo "=== Locate DocumentStatus.tsx files ==="
find . -maxdepth 6 -type f -name 'DocumentStatus.tsx' -print || true
echo
echo "=== Show up to first 300 lines of any DocumentStatus.tsx found ==="
while IFS= read -r file; do
echo "---- FILE: $file ----"
sed -n '1,300p' "$file" || true
done < <(find . -maxdepth 6 -type f -name 'DocumentStatus.tsx' -print) || true
echo
echo "=== Search for sendGAEvent definition(s) ==="
rg -n --hidden --no-ignore "function sendGAEvent|export function sendGAEvent|export const sendGAEvent|const sendGAEvent =|sendGTMEvent" -S || true
echo
echo "=== Search for GA data layer typing (interfaces / types) ==="
rg -n --hidden --no-ignore "interface .*GADataLayerEvent|type .*GADataLayerEvent|export .*GADataLayerEvent" -S || true
echo
echo "=== Done ==="Length of output: 2226 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== src/types/types.ts ==="
if [ -f src/types/types.ts ]; then
sed -n '1,240p' src/types/types.ts
else
echo "NOT FOUND: src/types/types.ts"
fi
echo
echo "=== src/lib/gtmService.ts ==="
if [ -f src/lib/gtmService.ts ]; then
sed -n '1,240p' src/lib/gtmService.ts
else
echo "NOT FOUND: src/lib/gtmService.ts"
fi
echo
echo "=== src/components/content/DocumentStatus.tsx ==="
if [ -f src/components/content/DocumentStatus.tsx ]; then
sed -n '1,240p' src/components/content/DocumentStatus.tsx
else
echo "NOT FOUND: src/components/content/DocumentStatus.tsx"
fi
echo
echo "=== src/components/content/DocumentPreview.tsx ==="
if [ -f src/components/content/DocumentPreview.tsx ]; then
sed -n '1,240p' src/components/content/DocumentPreview.tsx
else
echo "NOT FOUND: src/components/content/DocumentPreview.tsx"
fi
echo
echo "=== Search for any document_id occurrences ==="
rg -n --hidden --no-ignore "document_id" -S || echo "no matches"Length of output: 6261 Normalize analytics keys and add document_id — fix typing & verify GTM mappings
Location: src/components/content/DocumentStatus.tsx (sendGAEvent call in the QR DialogTrigger onClick). 🤖 Prompt for AI Agents |
||
| onStatusClick({ | ||
| url: status.url[selectedSchema], | ||
| documentId: id, | ||
| label: status.label, | ||
| documentTitle: title, | ||
| }) | ||
| } | ||
| }); | ||
| }} | ||
| > | ||
| <div className="w-4 h-4 flex items-center justify-center"> | ||
| <img className="w-[13px] h-[13px]" alt="Qrcode" src="/qrcode.svg" id="qr-code-icon" /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use a semantic button for the clickable control
This is an interactive control inside a dialog trigger; a
<div>is not keyboard-focusable by default. Prefer a<button>(or add proper a11y props) to meet a11y expectations.Remember to close with
</button>where the</div>currently is.📝 Committable suggestion
🤖 Prompt for AI Agents