Skip to content

Commit

Permalink
fix page view issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vabatista committed Mar 14, 2024
1 parent 7d45ec4 commit 0f5e835
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/details-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export default function DetailsPage() {
const { postId } = useParams();
const navigate = useNavigate();

ReactGA.send({ hitType: "pageview", page: postId, title: post.title });

useEffect(() => {
const getPostById = async () => {
try {
await axios.get(process.env.REACT_APP_API_PATH + `/api/posts/${postId}`).then((response) => {
setIsLoading(false);
setPost(response.data);
ReactGA.send({ hitType: "pageview", page: postId, title: response.data.title });

});
} catch (error) {
Expand Down

0 comments on commit 0f5e835

Please sign in to comment.