Skip to content

Commit

Permalink
fix: log the shopLink
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 6, 2023
1 parent 4a9c0d2 commit 7977f8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export const Home: NextPage = () => {
href={CHECKOUT_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() => analytics.track("ShopLink Clicked")}
>
「购买次数」
</a>
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Home(): React.ReactElement {
setAnalytics(response);
// @ts-ignore
window.analytics = response;
window.analytics?.identify("'hello world' from segmentio analytics");
window.analytics?.page();
} catch (err) {
console.error(err);
setAnalytics(undefined);
Expand Down
4 changes: 4 additions & 0 deletions pages/shop.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useAnalytics } from "~/components/context/analytics";
import SquigglyLines from "../components/SquigglyLines";
import { CHECKOUT_URL, RATE_LIMIT_COUNT } from "../utils/constants";

export default () => {
const { analytics } = useAnalytics();

return (
<div>
<h2 className="mt-10 max-w-5xl pb-10 text-center text-4xl font-bold sm:text-7xl">
Expand All @@ -11,6 +14,7 @@ export default () => {
<a
className="relative text-pink-400 hover:underline"
href={CHECKOUT_URL}
onClick={() => analytics.track("ShopLink Clicked")}
>
点击购买
</a>
Expand Down

1 comment on commit 7977f8e

@vercel
Copy link

@vercel vercel bot commented on 7977f8e Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.