File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
templates/dart/guides/search Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ { {> snippets/import} }
2+
3+ String getGoogleAnalyticsUserIdFromBrowserCookie(String cookieName) {
4+ // This function is a placeholder for a real implementation
5+ return " " ;
6+ }
7+
8+ void searchWithGAToken() async {
9+ {{> snippets/init} }
10+
11+ final userToken = getGoogleAnalyticsUserIdFromBrowserCookie("_ga");
12+ var searchParams = SearchParamsObject(query: "<YOUR _SEARCH_QUERY >", userToken: userToken);
13+
14+ await { {#dynamicSnippet} }searchWithSearchParams{ {/dynamicSnippet} };
15+
16+ String? loggedInUser;
17+ searchParams = SearchParamsObject(query: "<YOUR _SEARCH_QUERY >", userToken: loggedInUser ?? userToken);
18+
19+ await { {#dynamicSnippet} }searchWithSearchParams{ {/dynamicSnippet} };
20+ }
You can’t perform that action at this time.
0 commit comments