-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[No QA] Add GoogleTagManger libs #51201
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8f1dd31
add GTM lib for web
arosiclair 5025a7b
add doc
arosiclair 99c1ee6
upgrade react-native-firebase packages
arosiclair 7d29053
update patches
arosiclair 411de42
add GoogleTagManagerModule type
arosiclair 4e8fdc7
add GTM lib for native
arosiclair f5cc230
add doc
arosiclair e6fd09e
Revert "upgrade react-native-firebase packages"
arosiclair 049dbfa
Revert "update patches"
arosiclair 5fe33c2
enable firebase debug mode in dev scheme
arosiclair 0988a70
Merge branch 'main' of github.com:Expensify/App into arosiclair-gtm-lib
arosiclair 92c5442
use googleService-Info.plist from firebase
arosiclair 5763e7c
add -FIRAnalyticsDebugEnabled argument
arosiclair 77aadf1
add dev plist
arosiclair f6faa94
add google-services.json for dev
arosiclair d4c3df2
enable IS_ANALYTICS_ENABLED
arosiclair f1ff0dd
add USE_THIRD_PARTY_SCRIPTS env variable for testing
arosiclair 91b9349
check for dataLayer
arosiclair 4bdc074
Merge branch 'main' of github.com:Expensify/App into arosiclair-gtm-lib
arosiclair 34dab29
Merge branch 'main' of github.com:Expensify/App into arosiclair-gtm-lib
arosiclair 7eb2b61
Merge branch 'main' of github.com:Expensify/App into arosiclair-gtm-lib
arosiclair bac72c5
add USE_THIRD_PARTY_SCRIPTS example
arosiclair d7afd75
EOF new lines
arosiclair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| { | ||
| "project_info": { | ||
| "project_number": "921154746561", | ||
| "firebase_url": "https://expensify-chat.firebaseio.com", | ||
| "project_id": "expensify-chat", | ||
| "storage_bucket": "expensify-chat.appspot.com" | ||
| }, | ||
| "client": [ | ||
| { | ||
| "client_info": { | ||
| "mobilesdk_app_id": "1:921154746561:android:4f04268f25f84eaf027c40", | ||
| "android_client_info": { | ||
| "package_name": "com.expensify.chat" | ||
| } | ||
| }, | ||
| "oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| } | ||
| ], | ||
| "api_key": [ | ||
| { | ||
| "current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk" | ||
| } | ||
| ], | ||
| "services": { | ||
| "appinvite_service": { | ||
| "other_platform_oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| }, | ||
| { | ||
| "client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com", | ||
| "client_type": 2, | ||
| "ios_info": { | ||
| "bundle_id": "com.expensify.chat.adhoc" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "client_info": { | ||
| "mobilesdk_app_id": "1:921154746561:android:333e293a7fef83a8027c40", | ||
| "android_client_info": { | ||
| "package_name": "com.expensify.chat.adhoc" | ||
| } | ||
| }, | ||
| "oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| } | ||
| ], | ||
| "api_key": [ | ||
| { | ||
| "current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk" | ||
| } | ||
| ], | ||
| "services": { | ||
| "appinvite_service": { | ||
| "other_platform_oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| }, | ||
| { | ||
| "client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com", | ||
| "client_type": 2, | ||
| "ios_info": { | ||
| "bundle_id": "com.expensify.chat.adhoc" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "client_info": { | ||
| "mobilesdk_app_id": "1:921154746561:android:3b19fdbaedb5b586027c40", | ||
| "android_client_info": { | ||
| "package_name": "com.expensify.chat.dev" | ||
| } | ||
| }, | ||
| "oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-svjnccrcn6vet45kn9o7sibb3jemipa6.apps.googleusercontent.com", | ||
| "client_type": 1, | ||
| "android_info": { | ||
| "package_name": "com.expensify.chat.dev", | ||
| "certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625" | ||
| } | ||
| }, | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| } | ||
| ], | ||
| "api_key": [ | ||
| { | ||
| "current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk" | ||
| } | ||
| ], | ||
| "services": { | ||
| "appinvite_service": { | ||
| "other_platform_oauth_client": [ | ||
| { | ||
| "client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| }, | ||
| { | ||
| "client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com", | ||
| "client_type": 2, | ||
| "ios_info": { | ||
| "bundle_id": "com.expensify.chat.adhoc" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "configuration_version": "1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>CLIENT_ID</key> | ||
| <string>921154746561-8niu5ba8g4dgsqsqso3lugdhe6vikqpq.apps.googleusercontent.com</string> | ||
| <key>REVERSED_CLIENT_ID</key> | ||
| <string>com.googleusercontent.apps.921154746561-8niu5ba8g4dgsqsqso3lugdhe6vikqpq</string> | ||
| <key>ANDROID_CLIENT_ID</key> | ||
| <string>921154746561-cbegir0tnc2gan6k1gre5vtn75p60hom.apps.googleusercontent.com</string> | ||
| <key>API_KEY</key> | ||
| <string>AIzaSyA9Qn7q5Iw26gTzjI7012C4PaFrFagpC_I</string> | ||
| <key>GCM_SENDER_ID</key> | ||
| <string>921154746561</string> | ||
| <key>PLIST_VERSION</key> | ||
| <string>1</string> | ||
| <key>BUNDLE_ID</key> | ||
| <string>com.expensify.chat.dev</string> | ||
| <key>PROJECT_ID</key> | ||
| <string>expensify-chat</string> | ||
| <key>STORAGE_BUCKET</key> | ||
| <string>expensify-chat.appspot.com</string> | ||
| <key>IS_ADS_ENABLED</key> | ||
| <false></false> | ||
| <key>IS_ANALYTICS_ENABLED</key> | ||
| <false></false> | ||
| <key>IS_APPINVITE_ENABLED</key> | ||
| <true></true> | ||
| <key>IS_GCM_ENABLED</key> | ||
| <true></true> | ||
| <key>IS_SIGNIN_ENABLED</key> | ||
| <true></true> | ||
| <key>GOOGLE_APP_ID</key> | ||
| <string>1:921154746561:ios:12c3a0b9276d7d2f027c40</string> | ||
| <key>DATABASE_URL</key> | ||
| <string>https://expensify-chat.firebaseio.com</string> | ||
| </dict> | ||
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import analytics from '@react-native-firebase/analytics'; | ||
| import Log from '@libs/Log'; | ||
| import type {GoogleTagManagerEvent} from './types'; | ||
| import type GoogleTagManagerModule from './types'; | ||
|
|
||
| function publishEvent(event: GoogleTagManagerEvent, accountID: number) { | ||
| analytics().logEvent(event, {accountID}); | ||
| Log.info('[GTM] event published', false, {event, accountID}); | ||
| } | ||
|
|
||
| const GoogleTagManager: GoogleTagManagerModule = { | ||
| publishEvent, | ||
| }; | ||
|
|
||
| export default GoogleTagManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import Log from '@libs/Log'; | ||
| import type {GoogleTagManagerEvent} from './types'; | ||
| import type GoogleTagManagerModule from './types'; | ||
|
|
||
| /** | ||
| * The dataLayer is added with a js snippet from Google in web/thirdPartyScripts.js. Set USE_THIRD_PARTY_SCRIPTS to true | ||
| * in your .env to enable this | ||
| */ | ||
| type WindowWithDataLayer = Window & { | ||
| dataLayer?: { | ||
| push: (params: DataLayerPushParams) => void; | ||
| }; | ||
| }; | ||
|
|
||
| type DataLayerPushParams = { | ||
| event: GoogleTagManagerEvent; | ||
| accountID: number; | ||
| }; | ||
|
|
||
| declare const window: WindowWithDataLayer; | ||
|
|
||
| function publishEvent(event: GoogleTagManagerEvent, accountID: number) { | ||
| if (!window.dataLayer) { | ||
| return; | ||
|
neil-marcellini marked this conversation as resolved.
|
||
| } | ||
|
|
||
| window.dataLayer.push({event, accountID}); | ||
| Log.info('[GTM] event published', false, {event, accountID}); | ||
| } | ||
|
|
||
| const GoogleTagManager: GoogleTagManagerModule = { | ||
| publishEvent, | ||
| }; | ||
|
|
||
| export default GoogleTagManager; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.