mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
📊 feat: Google tag manager integration (#2469)
* Google tag manager integration * change location of react-gtm-module package * refactor: move react-gtm-module usage from Chat/Footer to useAppStartup hook --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
4416f69a9b
commit
97d12d03d1
7 changed files with 29 additions and 0 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import React from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import TagManager from 'react-gtm-module';
|
||||
import { Constants } from 'librechat-data-provider';
|
||||
import { useGetStartupConfig } from 'librechat-data-provider/react-query';
|
||||
import { useLocalize } from '~/hooks';
|
||||
|
||||
|
||||
export default function Footer({ className }: { className?: string }) {
|
||||
const { data: config } = useGetStartupConfig();
|
||||
const localize = useLocalize();
|
||||
|
|
@ -33,6 +35,13 @@ export default function Footer({ className }: { className?: string }) {
|
|||
</a>
|
||||
);
|
||||
|
||||
if (config?.analyticsGtmId) {
|
||||
const tagManagerArgs = {
|
||||
gtmId: config?.analyticsGtmId,
|
||||
};
|
||||
TagManager.initialize(tagManagerArgs);
|
||||
}
|
||||
|
||||
const mainContentParts = (
|
||||
typeof config?.customFooter === 'string'
|
||||
? config.customFooter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue