mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 17:39:24 +00:00
Forward and back scarf fires
This commit is contained in:
parent
2cada1697c
commit
fe1c44fdaa
@ -6,6 +6,7 @@ import { useEffect, useCallback } from 'react';
|
|||||||
import { WorkbenchType, ToolId } from '../types/navigation';
|
import { WorkbenchType, ToolId } from '../types/navigation';
|
||||||
import { parseToolRoute, updateToolRoute, clearToolRoute } from '../utils/urlRouting';
|
import { parseToolRoute, updateToolRoute, clearToolRoute } from '../utils/urlRouting';
|
||||||
import { ToolRegistry } from '../data/toolsTaxonomy';
|
import { ToolRegistry } from '../data/toolsTaxonomy';
|
||||||
|
import { firePixel } from '../utils/scarfTracking';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook to sync workbench and tool with URL using registry
|
* Hook to sync workbench and tool with URL using registry
|
||||||
@ -54,6 +55,10 @@ export function useNavigationUrlSync(
|
|||||||
const handlePopState = () => {
|
const handlePopState = () => {
|
||||||
const route = parseToolRoute(registry);
|
const route = parseToolRoute(registry);
|
||||||
if (route.toolId !== selectedTool) {
|
if (route.toolId !== selectedTool) {
|
||||||
|
// Fire pixel for back/forward navigation
|
||||||
|
const currentPath = window.location.pathname;
|
||||||
|
firePixel(currentPath);
|
||||||
|
|
||||||
if (route.toolId) {
|
if (route.toolId) {
|
||||||
handleToolSelect(route.toolId);
|
handleToolSelect(route.toolId);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user