解説:window.dataLayer = window.dataLayer || [];

解説記事

window.dataLayer = window.dataLayer || [];

について解説します。

<script>
  window.dataLayer = window.dataLayer || [];
  dataLayer.push({
    event: "purchase",
    ecommerce: {
(以下省略)

dataLayerはJavaScriptで「配列」と呼ばれるものになります。

「配列」は中にいろいろな要素をリスト形式で保有することができるもので、

そして「配列」はその要素を追加・削除・検索など行うことが可能です。

dataLayerは「継ぎ足し継ぎ足ししていく」のが本来的な使い方です。

 window.dataLayer = window.dataLayer || [];

は、「dataLayerという名前で配列を新規作成する」というものになります。

GTMはページ上にdataLayerという配列が存在したらそちらを利用する形です。

(存在しない場合はGTMが勝手に作成します)

そして、dataLayer.push()というのは上で触れた「配列に要素を追加する」ものとなり、()の中身をdataLayerに追加する、という文法になっています。 これによって、たとえば「event: “purchase”」の場合は、「作成した配列に対してpurchase用のデータを追加する」形になります。

関連記事

特集記事

コメント

  1. Thaank you a llot ffor sharing this with all people you actuazlly know wbat you’re speaking approximately!
    Bookmarked. Kindly additionally consult with my site =). We could have a hyperlink alternate agreement among us

  2. It’s awesome for me to hae a website, which is valuiable in faavor of myy experience.
    thanhks admin

  3. Attractiive section of content. I just stumbled upon your blog and in accessin caapital to
    ssert that I acquikre actually enjoyed account yur blog
    posts. Anyway I will be subscribing tto your feeds andd even I achievement you access
    coknsistently fast.

  4. Appreciation to my father whho stated to me about
    this webpage, this webpage is in fact amazing.

  5. What a aterial off un-ambiguity andd preserveness of precious
    knowledge on tthe topiic off unexpected feelings.

  6. Wow! Finaoly I got a web site frfom where I bbe capable oof geenuinely
    get helpful factrs regarding my study and knowledge.

  7. Great post.

  8. Heya i’m foor tthe first time here. I cqme acroes this board andd I find It realoy useful & it helped me out
    a lot. I ope to give something baxk annd aiid others like yyou aided me.

  9. wow, awesome blog post.Much thanks again. Great.

  10. Appreciate you sharing, great article post.Really looking forward to read more. Awesome.

  11. Fantastic blog post.Really thank you! Cool.

  12. Very neat blog post.Really looking forward to read more. Want more.

  13. Thanks for the blog article.Really looking forward to read more. Really Cool.

  14. I have realized that over the course of building a relationship with real estate proprietors, you’ll be able to get them to understand that, in most real estate transaction, a percentage is paid. Eventually, FSBO sellers tend not to “save” the payment. Rather, they try to earn the commission by simply doing a great agent’s work. In this, they spend their money and time to complete, as best they could, the responsibilities of an realtor. Those tasks include uncovering the home by means of marketing, introducing the home to all buyers, creating a sense of buyer desperation in order to trigger an offer, arranging home inspections, handling qualification check ups with the loan company, supervising fixes, and facilitating the closing.

  15. In line with my study, after a foreclosures home is sold at a sale, it is common for any borrower to be able to still have a remaining unpaid debt on the mortgage loan. There are many creditors who try and have all fees and liens repaid by the subsequent buyer. Nevertheless, depending on a number of programs, legislation, and state laws and regulations there may be many loans which aren’t easily solved through the switch of lending options. Therefore, the responsibility still falls on the debtor that has had his or her property in foreclosure. Thank you sharing your opinions on this website.

  16. I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web smart so I’m not 100 certain. Any tips or advice would be greatly appreciated. Cheers

  17. I?d have to check with you here. Which isn’t one thing I often do! I get pleasure from studying a put up that can make people think. Additionally, thanks for allowing me to comment!

  18. Thanks for the different tips discussed on this web site. I have noticed that many insurance carriers offer prospects generous special discounts if they decide to insure a couple of cars with them. A significant variety of households possess several cars these days, in particular those with old teenage young children still located at home, as well as savings for policies can easily soon mount up. So it pays to look for a bargain.

  19. This really answered my downside, thank you!

  20. A lot of what you say happens to be supprisingly precise and it makes me ponder why I had not looked at this in this light before. This particular piece truly did turn the light on for me personally as far as this specific subject matter goes. However there is actually one point I am not too cozy with so whilst I make an effort to reconcile that with the actual core idea of the position, permit me observe exactly what all the rest of the subscribers have to say.Nicely done.

  21. Thanks for your advice on this blog. 1 thing I would want to say is always that purchasing consumer electronics items from the Internet is certainly not new. In reality, in the past decades alone, the marketplace for online electronic products has grown a great deal. Today, you will find practically virtually any electronic device and gizmo on the Internet, from cameras plus camcorders to computer parts and video games consoles.

  22. One thing I would really like to say is car insurance termination is a feared experience so if you’re doing the best things as being a driver you may not get one. A lot of people do receive the notice that they’ve been officially dumped by their particular insurance company they have to struggle to get more insurance following a cancellation. Low-cost auto insurance rates are generally hard to get following a cancellation. Knowing the main reasons for auto insurance termination can help drivers prevent burning off one of the most vital privileges accessible. Thanks for the concepts shared through your blog.

  23. I discovered more new things on this losing weight issue. 1 issue is a good nutrition is especially vital if dieting. A big reduction in fast foods, sugary food, fried foods, sugary foods, beef, and white colored flour products may be necessary. Retaining wastes harmful bacteria, and toxins may prevent targets for fat loss. While certain drugs momentarily solve the situation, the nasty side effects aren’t worth it, and they never present more than a short-lived solution. It is a known fact that 95 of fad diets fail. Many thanks sharing your ideas on this website.

  24. I have observed that online education is getting well-liked because attaining your college degree online has become a popular choice for many people. A lot of people have not necessarily had an opportunity to attend a regular college or university but seek the improved earning possibilities and career advancement that a Bachelors Degree offers. Still people might have a college degree in one training but would wish to pursue one thing they already have an interest in.

  25. Thanks for revealing your ideas in this article. The other issue is that whenever a problem develops with a personal computer motherboard, individuals should not go ahead and take risk of repairing the item themselves for if it is not done correctly it can lead to irreparable damage to the whole laptop. Most commonly it is safe just to approach a dealer of your laptop for your repair of motherboard. They will have technicians who have an competence in dealing with mobile computer motherboard problems and can have the right analysis and execute repairs.

  26. Muchos Gracias for your blog article. Fantastic.

  27. Almanya’nın en iyi medyumu haluk hoca sayesinde sizlerde güven içerisinde çalışmalar yaptırabilirsiniz, 40 yıllık uzmanlık ve tecrübesi ile sizlere en iyi medyumluk hizmeti sunuyoruz.

  28. http://www.thebudgetart.com is trusted worldwide canvas wall art prints & handmade canvas paintings online store. Thebudgetart.com offers budget price & high quality artwork, up-to 50 OFF, FREE Shipping USA, AUS, NZ & Worldwide Delivery.

  29. Very informative blog. Will read on…

  30. Thanks-a-mundo for the blog article.Thanks Again. Really Cool.

  31. Wow, great blog post.Thanks Again. Great.

  32. This is one awesome blog.Much thanks again. Will read on…

  33. Thanks-a-mundo for the article post.Really looking forward to read more. Want more.

  34. Im obliged for the blog.Really thank you! Awesome.

  35. I loved your blog post. Cool.

  36. Great, thanks for sharing this post. Fantastic.

  37. I think this is a real great blog.Really looking forward to read more. Awesome.

  38. Very informative article.Really thank you! Really Great.

  39. Great blog article. Cool.

  40. I value the post.Much thanks again.

  41. Im grateful for the article post.Much thanks again. Really Great.

  42. Hey, thanks for the blog.Really thank you!

  43. Very good blog article.Much thanks again. Awesome.

  44. Major thankies for the blog post.Really looking forward to read more. Fantastic.

  45. This is one awesome article.Thanks Again. Want more.

  46. Thanks for the article. Keep writing.

  47. Hey, thanks for the blog article.Much thanks again. Really Cool.

  48. Im thankful for the blog. Will read on…

  49. I really enjoy the blog post. Want more.

  50. Major thanks for the article post.Really thank you! Great.

  51. Thanks so much for the blog article.Thanks Again. Really Great.

  52. Enjoyed every bit of your article.

  53. Thanks a lot for the post.Really looking forward to read more. Cool.

  54. Im grateful for the article post.Thanks Again. Want more.

  55. Major thankies for the blog article. Will read on…

  56. Hey, thanks for the article post.Really looking forward to read more. Keep writing.

  57. Very neat article.Really looking forward to read more. Will read on…

  58. Muchos Gracias for your blog post.Really thank you! Fantastic.

  59. wow, awesome blog.Thanks Again. Much obliged.

  60. This is one awesome post.Really thank you! Will read on…

  61. Great blog.Really thank you! Keep writing.

  62. A round of applause for your blog. Keep writing.

  63. I am so grateful for your blog article.Thanks Again. Will read on…

  64. Thank you ever so for you post.Much thanks again.

  65. Im obliged for the article.Thanks Again. Much obliged.

  66. I really enjoy the blog post.Really looking forward to read more. Keep writing.

  67. I really enjoy the blog.Thanks Again. Awesome.

  68. Wow, great blog post.Thanks Again. Great.

  69. I really like and appreciate your article post.Much thanks again.

  70. Fantastic blog post. Will read on…

  71. wow, awesome post. Awesome.

  72. Thanks-a-mundo for the article.Really thank you! Awesome.

  73. Appreciate you sharing, great blog article.Really thank you!

  74. A big thank you for your blog.Thanks Again. Will read on…

  75. Awesome post.Thanks Again. Really Cool.

  76. The most talked about weight loss product is finally here! FitSpresso is a powerful supplement that supports healthy weight loss the natural way. Clinically studied ingredients work synergistically to support healthy fat burning, increase metabolism and maintain long lasting weight loss. https://fitspresso-try.com/

  77. Thank you for your blog.Much thanks again. Really Cool.

  78. Thanks so much for the post. Want more.

  79. Muchos Gracias for your blog.Thanks Again. Will read on…

  80. I cannot thank you enough for the blog.

  81. wow, awesome blog article. Will read on…

  82. Thanks again for the blog post.Really thank you! Cool.

  83. A big thank you for your blog post.Really thank you! Really Great.

  84. Fantastic article post.Much thanks again. Fantastic.

  85. I really like and appreciate your blog.Really looking forward to read more. Awesome.

  86. Really enjoyed this blog post. Great.

  87. Looking forward to reading more. Great blog post. Want more.

  88. Really appreciate you sharing this blog.Really looking forward to read more. Want more.

  89. Thanks-a-mundo for the blog.Thanks Again. Great.

  90. I think this is a real great article post.Much thanks again. Much obliged.

  91. Very good article post.Really thank you!

  92. Thanks for sharing, this is a fantastic blog article.Thanks Again. Cool.

  93. Thanks again for the blog.Really looking forward to read more. Much obliged.

  94. Thank you for your blog post.Much thanks again. Much obliged.

  95. Thanks for sharing, this is a fantastic blog article.Thanks Again. Fantastic.

  96. wow, awesome blog article.Much thanks again. Really Cool.

  97. Muchos Gracias for your article. Great.

  98. Appreciate you sharing, great article post.Really looking forward to read more. Fantastic.

  99. I think this is a real great blog.Really thank you!

  100. I loved your article post.Really thank you! Want more.

  101. I am so grateful for your post.Really looking forward to read more. Awesome.

  102. Muchos Gracias for your article post.Really thank you! Cool.

  103. This is one awesome blog article.Really looking forward to read more. Fantastic.

  104. Major thanks for the post.Thanks Again. Great.

  105. Im obliged for the article.Much thanks again. Keep writing.

  106. I think this is a real great blog article.Much thanks again. Really Cool.

  107. Muchos Gracias for your post.Really looking forward to read more.

  108. Thank you for your article.Really looking forward to read more. Will read on…

  109. Major thanks for the blog.Thanks Again. Want more.

  110. I appreciate you sharing this blog article. Great.

  111. Fantastic article.Much thanks again. Keep writing.

  112. Awesome blog.Really thank you! Awesome.

  113. Fantastic post.Really looking forward to read more. Awesome.

  114. A round of applause for your blog post. Really Great.

  115. I loved your article post. Much obliged.

  116. I truly appreciate this article post.Thanks Again.

  117. Im obliged for the article. Will read on…

  118. A round of applause for your article.Thanks Again. Want more.

  119. You have mentioned very interesting points! ps nice web site.Raise blog range

  120. Im thankful for the article. Really Cool.

  121. Very good article.Much thanks again. Really Cool.

  122. Hey, thanks for the blog post.

  123. Very neat article.Really thank you! Much obliged.

  124. Awesome article post.Really looking forward to read more. Want more.

  125. Thanks a lot for the post.Thanks Again. Fantastic.

  126. I really like and appreciate your blog post.Really looking forward to read more. Really Cool.

  127. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  128. Wow, great article post.Thanks Again. Awesome.

  129. Im obliged for the blog article.Thanks Again. Want more.

  130. Thanks-a-mundo for the blog post.Really looking forward to read more. Want more.

  131. Muchos Gracias for your blog post.Really thank you! Fantastic.

  132. I loved your article post.Really looking forward to read more. Really Great.

  133. Enjoyed every bit of your blog post.Thanks Again. Fantastic.

  134. Im obliged for the blog post.Much thanks again. Fantastic.

  135. Really enjoyed this blog.Really looking forward to read more. Will read on…

  136. Thanks so much for the blog article.Really thank you!

  137. I really liked your blog post. Great.

  138. I really liked your article.Really looking forward to read more. Will read on…

  139. Thank you for your blog.Thanks Again. Cool.

  140. Really enjoyed this blog. Great.

  141. Thanks for sharing, this is a fantastic blog.Thanks Again. Great.

  142. Appreciate you sharing, great blog post. Great.

  143. I really enjoy the blog article.Really looking forward to read more.

  144. I truly appreciate this article.Really looking forward to read more. Awesome.

  145. A round of applause for your post. Will read on…

  146. A round of applause for your blog article.Thanks Again. Will read on…

  147. Very good blog.Much thanks again. Much obliged.

  148. Major thanks for the blog. Keep writing.

  149. Thank you ever so for you article.Really thank you! Awesome.

  150. I cannot thank you enough for the blog post.Really thank you! Keep writing.

  151. Good day! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my site to rank for some targeted keywords but I’m not seeing
    very good success. If you know of any please share.
    Kudos! You can read similar text here: Eco product

ランキング(週間)

  1. 1

    GA4 「ページ ロケーション」と「ページ パス と スクリーン クラス」何が違う?ドメインの有無以外にもパラメータの扱いに違いあり

  2. 2

    GA4の探索で「ページ別訪問数」を見ることは可能か?

  3. 3

    GA4のレポート画面の数値データは、イベント発生時から何時間後に確定するのか?

  4. 4

    GA4 拡張計測機能の新顔「フォームの操作」 form_start, form_submit

  5. 5

    user_idのような高基数(high cardinality)のディメンション

  6. 6

    Ads Data Hub(ADH) とはどんなものですか?GA4との関連は?

  7. 7

    GA4で異なるドメイン(サブドメイン)の同一ページパスをドメイン付きで表示する

  8. 8

    GA4 クロスドメイン設定では、リンク先に「_gl」パラメータが付く。勝手なパラメータを付けるとエラーになるページは要注意

  9. 9

    YouTubeの概要欄に貼られたリンクをクリックしてサイトを訪れたユーザーを計測するために

  10. 10

    GA4で設定したイベントの消し方(削除の仕方)

最近の記事

  1. 生成AIを調整してABテストを実装したら想像以上に早かった

  2. 無料で使えるABテストツールのバージョンアップを行いました

  3. 無料ABテストツール(and,B)のマニュアルを作成しました

カテゴリー

 
TOP