File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/codes/clj/docs/frontend/infra
test/codes/clj/docs/frontend/test/infra Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 14
14
(defn google-tag
15
15
[ga-tag-id gtm-script]
16
16
(let [script (js/document.createElement " script" )]
17
- (set! (.-src script) (str " window.dataLayer = window.dataLayer || [];
18
- function gtag(){dataLayer.push(arguments);}
19
- gtag('js', new Date());
20
-
21
- gtag('config', '" ga-tag-id " ');" ))
17
+ (set! (.-text script) (str " window.dataLayer = window.dataLayer || [];
18
+ function gtag(){dataLayer.push(arguments);}
19
+ gtag('js', new Date());
20
+
21
+ gtag('config', '" ga-tag-id " ');" ))
22
22
(js/document.head.insertBefore script (.-nextSibling gtm-script))))
23
23
24
24
(defn ga-scripts
Original file line number Diff line number Diff line change 8
8
(let [ga-tag-id " G-0123456789"
9
9
ga-scripts (analytics/ga-scripts ga-tag-id)]
10
10
(is (instance? js/HTMLScriptElement ga-scripts))
11
- (is (string/includes? (.-src ga-scripts) ga-tag-id))))
11
+ (is (string/includes? (.-text ga-scripts) ga-tag-id))))
12
12
(testing " blank GA_TAG_ID should not return anything"
13
13
(is (nil? (analytics/ga-scripts " " )))))
You can’t perform that action at this time.
0 commit comments