Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit3c1af49

Browse files
hasittyaga001
authored andcommitted
Add segment script and update iframe attributes for YouTube video player (#68)
1 parente5e33a0 commit3c1af49

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

‎docusaurus.config.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ const config: Config = {
164164
"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",
165165
"/docs/js/code-block-buttons.js",
166166
"https://cdnjs.cloudflare.com/ajax/libs/axios/1.2.1/axios.min.js",
167+
{
168+
src:"/js/segment.js",
169+
async:false,
170+
},
167171
{
168172
src:"https://js.hs-scripts.com/43613284.js",
169173
type:"text/javascript",

‎static/js/segment.js‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
!(function(){
2+
vari="analytics",
3+
analytics=(window[i]=window[i]||[]);
4+
if(!analytics.initialize)
5+
if(analytics.invoked)
6+
window.console&&
7+
console.error&&
8+
console.error("Segment snippet included twice.");
9+
else{
10+
analytics.invoked=!0;
11+
analytics.methods=[
12+
"trackSubmit",
13+
"trackClick",
14+
"trackLink",
15+
"trackForm",
16+
"pageview",
17+
"identify",
18+
"reset",
19+
"group",
20+
"track",
21+
"ready",
22+
"alias",
23+
"debug",
24+
"page",
25+
"screen",
26+
"once",
27+
"off",
28+
"on",
29+
"addSourceMiddleware",
30+
"addIntegrationMiddleware",
31+
"setAnonymousId",
32+
"addDestinationMiddleware",
33+
"register",
34+
];
35+
analytics.factory=function(e){
36+
returnfunction(){
37+
if(window[i].initialized)
38+
returnwindow[i][e].apply(window[i],arguments);
39+
varn=Array.prototype.slice.call(arguments);
40+
if(
41+
["track","screen","alias","group","page","identify"].indexOf(
42+
e
43+
)>-1
44+
){
45+
varc=document.querySelector("link[rel='canonical']");
46+
n.push({
47+
__t:"bpc",
48+
c:(c&&c.getAttribute("href"))||void0,
49+
p:location.pathname,
50+
u:location.href,
51+
s:location.search,
52+
t:document.title,
53+
r:document.referrer,
54+
});
55+
}
56+
n.unshift(e);
57+
analytics.push(n);
58+
returnanalytics;
59+
};
60+
};
61+
for(varn=0;n<analytics.methods.length;n++){
62+
varkey=analytics.methods[n];
63+
analytics[key]=analytics.factory(key);
64+
}
65+
analytics.load=function(key,n){
66+
vart=document.createElement("script");
67+
t.type="text/javascript";
68+
t.async=!0;
69+
t.setAttribute("data-global-segment-analytics-key",i);
70+
t.src=
71+
"https://cdn.segment.com/analytics.js/v1/"+
72+
key+
73+
"/analytics.min.js";
74+
varr=document.getElementsByTagName("script")[0];
75+
r.parentNode.insertBefore(t,r);
76+
analytics._loadOptions=n;
77+
};
78+
analytics._writeKey="IvcQvqtKQS24hYl0lkuvsfFSCpCse4F8";
79+
analytics.SNIPPET_VERSION="5.2.0";
80+
analytics.load("IvcQvqtKQS24hYl0lkuvsfFSCpCse4F8");
81+
analytics.page();
82+
}
83+
})();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp