{"id":2089,"date":"2024-04-21T21:34:58","date_gmt":"2024-04-21T19:34:58","guid":{"rendered":"https:\/\/trackboxx.com\/?post_type=helpcenter&#038;p=2089"},"modified":"2025-11-28T11:00:03","modified_gmt":"2025-11-28T10:00:03","slug":"comment-puis-je-integrer-le-script-de-suivi-dans-mon-site","status":"publish","type":"helpcenter","link":"https:\/\/trackboxx.com\/fr\/helpcenter\/wie-binde-ich-das-tracking-script-in-meine-seite-ein","title":{"rendered":"Ajouter le script de suivi Trackboxx"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Pour que Trackboxx enregistre correctement les visites, tu dois ajouter le <strong>script de suivi<\/strong> \u00e0 ton site. Cette op\u00e9ration ne se fait qu'une fois ; ensuite, toutes les pages vues sont enregistr\u00e9es automatiquement.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">O\u00f9 placer le script de suivi ?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Le script doit \u00eatre plac\u00e9 dans l\u2019 <strong>en-t\u00eate de ton site<\/strong> , entre<br><span style=\"color: #0f0e17;background-color: #eef3f3\" class=\"stk-highlight\"><code>&lt;head><\/code> et l\u2019 <code>&lt;\/head><\/code><\/span>.<br>C\u2019est ainsi que <strong>toutes les pages de ton site seront prises en compte<\/strong> .<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Obtenir ton code de suivi personnel<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Une fen\u00eatre s\u2019ouvre ensuite avec ton <strong>code de suivi personnel<\/strong>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connecte-toi au tableau de bord Trackboxx.<\/li>\n\n\n\n<li>Ajoute un nouveau site (nom + URL).<\/li>\n\n\n\n<li>Une fen\u00eatre s\u2019ouvre ensuite avec ton <strong>code de suivi personnel<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Voici \u00e0 quoi ressemble le code, \u00e0 titre d\u2019exemple :<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span>&gt;<\/span><span class=\"javascript\">\n  (<span class=\"hljs-function\"><span class=\"hljs-keyword\">fonction<\/span>(<span class=\"hljs-params\">d, s, id, w, f<\/span>)<\/span>{\n      w[f] = w[f] || <span class=\"hljs-function\"><span class=\"hljs-keyword\">fonction<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\n          (w[f].q = w[f].q || []).push(<span class=\"hljs-built_in\">arguments<\/span>)\n      };\n      <span class=\"hljs-keyword\">var<\/span> js, fjs = d.getElementsByTagName(s)[<span class=\"hljs-number\">0<\/span>];\n      <span class=\"hljs-keyword\">if<\/span> (d.getElementById(id)){ <span class=\"hljs-keyword\">retour<\/span>; }\n      js = d.createElement(s) ; js.id = id ;\n      js.onload = <span class=\"hljs-function\"><span class=\"hljs-keyword\">fonction<\/span>(<span class=\"hljs-params\"><\/span>)<\/span>{\n          <span class=\"hljs-comment\">\/\/ le script distant a \u00e9t\u00e9 charg\u00e9<\/span>\n      } ;\n      js.async = <span class=\"hljs-literal\">true<\/span>;\n      js.src = <span class=\"hljs-string\">\"https:\/\/cdn.trackboxx.info\/p\/tracker.js\"<\/span>;\n      fjs.parentNode.insertBefore(js, fjs) ;\n  }(<span class=\"hljs-built_in\">document<\/span>, <span class=\"hljs-string\">'script<\/span>, <span class=\"hljs-string\">'trackboxx-script' (script)<\/span>, <span class=\"hljs-built_in\">window<\/span>, <span class=\"hljs-string\">'trackboxx' (bo\u00eete \u00e0 outils)<\/span>)) ;\n  trackboxx(<span class=\"hljs-string\">'set' (jeu)<\/span>, <span class=\"hljs-string\">'siteId<\/span>, <span class=\"hljs-string\">'TB-66377283'<\/span>) ;\n  trackboxx(<span class=\"hljs-string\">'trackPageview' (aper\u00e7u de la page)<\/span>);\n<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Langage du code :<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Important : il s\u2019agit uniquement d\u2019un exemple. Tu obtiendras ton code personnel dans le tableau de bord apr\u00e8s avoir cliqu\u00e9 sur Ajouter un site.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Une fois le code ajout\u00e9 \u00e0 ton site, Trackboxx commence \u00e0 enregistrer les visites.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ajouter le script de suivi \u00e0 WordPress<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress permet d\u2019ajouter le code \u00e0 l\u2019en-t\u00eate de plusieurs fa\u00e7ons. La m\u00e9thode la plus adapt\u00e9e d\u00e9pend de ta configuration, de ton th\u00e8me et de ton niveau technique.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. header.php (int\u00e9gration manuelle)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tu peux ajouter le code directement au fichier <strong>header.php<\/strong> de ton th\u00e8me.<br>Important : utilise un <strong>th\u00e8me enfant<\/strong>, sinon le code sera \u00e9cras\u00e9 lors de la prochaine mise \u00e0 jour.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Champs de code dans les r\u00e9glages du th\u00e8me<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">De nombreux th\u00e8mes modernes proposent un champ pour ajouter du code \u00e0 l\u2019en-t\u00eate, g\u00e9n\u00e9ralement dans les options du th\u00e8me ou l\u2019outil de personnalisation.<br>C\u2019est notamment le cas de th\u00e8mes avec constructeur de pages comme Avada, Divi ou Enfold.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Hooks et int\u00e9grations du th\u00e8me<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Certains th\u00e8mes et frameworks proposent des <strong>hooks<\/strong>qui permettent d\u2019ajouter proprement du code \u00e0 l\u2019en-t\u00eate, souvent sans modifier directement un fichier.<br>Consulte la documentation de ton th\u00e8me pour trouver le hook adapt\u00e9.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Ajouter le script avec un plugin<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">De nombreux plugins sont con\u00e7us pour ajouter des <strong>scripts de suivi ou d\u2019en-t\u00eate<\/strong> \u00e0 WordPress.<br>Recherche simplement :<br>\u00ab WordPress Header Script Plugin \u00bb ou \u00ab WordPress Tracking Script Plugin \u00bb.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Si tu veux utiliser le <strong>suivi e-commerce<\/strong> avec WooCommerce, par exemple, nous te recommandons un plugin, car la configuration n\u00e9cessite des r\u00e9glages suppl\u00e9mentaires.<\/p>","protected":false},"featured_media":0,"template":"","categories":[],"tags":[32],"class_list":["post-2089","helpcenter","type-helpcenter","status-publish","hentry","tag-helpcenter-erste-schritte"],"acf":[],"_links":{"self":[{"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/helpcenter\/2089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/helpcenter"}],"about":[{"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/types\/helpcenter"}],"version-history":[{"count":0,"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/helpcenter\/2089\/revisions"}],"wp:attachment":[{"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/media?parent=2089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/categories?post=2089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackboxx.com\/fr\/wp-json\/wp\/v2\/tags?post=2089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}