Comments on: DOM Scraping into Data Layer & Custom JS Variables https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/ APIs, Sheets, and Analytics Thu, 25 Feb 2021 08:44:30 +0000 hourly 1 https://wordpress.org/?v=6.5.5 By: Ludovic https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-21055 Mon, 07 Dec 2020 16:21:01 +0000 http://mixedanalytics.com/?p=7059#comment-21055 In reply to Ana.

Perfect ! Thanks 🙂

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-21053 Mon, 07 Dec 2020 16:00:45 +0000 http://mixedanalytics.com/?p=7059#comment-21053 In reply to Ludovic Lenglet.

Hi there, sorry, I'm not sure I totally understand the question. Can you please check the first script in this article and let me know if it's what you're looking for? It shows how to get the value of the closest ID or class:
https://mixedanalytics.com/blog/useful-custom-js-variables-google-tag-manager/

]]>
By: Ludovic Lenglet https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-21052 Mon, 07 Dec 2020 15:24:49 +0000 http://mixedanalytics.com/?p=7059#comment-21052 Here with html example :

div class="menu"
nav id="menu" class=navm
ul class="navlvavav"
li class="arzeazerzrazerzer-ara"
a href="www.site.fr" class="site"

]]>
By: Ludovic https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-21051 Mon, 07 Dec 2020 15:23:37 +0000 http://mixedanalytics.com/?p=7059#comment-21051 Interesting.

How it works if I wish catch an other class (div for example)?

In this case, when i clicking on www.site.fr, I wish catch "menu" from the div element.

Thanks

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-18144 Sun, 26 Jul 2020 08:06:07 +0000 http://mixedanalytics.com/?p=7059#comment-18144 In reply to Pravin.

Sorry, I'm not sure what you're asking. Can you please email a screenshot of what you're seeing?

]]>
By: Pravin https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-18141 Sun, 26 Jul 2020 02:38:55 +0000 http://mixedanalytics.com/?p=7059#comment-18141 In reply to pravin.

only get path[9].innerText like this help me

]]>
By: pravin https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-18140 Sun, 26 Jul 2020 02:36:37 +0000 http://mixedanalytics.com/?p=7059#comment-18140 it not working in my browesr

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-4261 Tue, 03 Jul 2018 04:36:47 +0000 http://mixedanalytics.com/?p=7059#comment-4261 In reply to Sara.

Hey Sara, good question. I just tested it and it doesn't work for me anymore either, so maybe something changed in a recent version of Dev Tools.
Luckily it's still pretty easy to get it: just use your mouse to highlight the full path in the Console, then click Ctrl-C to copy it and Ctrl-V to paste (just as you would in any other text application). I'll update the post. Please let me know if you have any problems!

]]>
By: Sara https://mixedanalytics.com/blog/dom-scraping-data-layer-gtm-custom-js-variables/#comment-4257 Mon, 02 Jul 2018 19:29:19 +0000 http://mixedanalytics.com/?p=7059#comment-4257 When I follow this step: Right-click and “Copy property path” to save this path to your clipboard. I am not getting the full path you're showing above. Instead, I only get .target.innerText. What am I doing wrong?

]]>