Comments on: DOM Scraping Together a Datalayer for Google Analytics Ecommerce Tracking https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/ APIs, Sheets, and Analytics Thu, 25 Feb 2021 08:43:55 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Ana https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-21899 Thu, 14 Jan 2021 08:14:16 +0000 http://mixedanalytics.com/?p=7257#comment-21899 In reply to Anonymous.

You don't need to reference your random number variable in a custom JS variable, it's already a variable. So instead of scraping the transaction ID off the page into a custom JS variable, you plug that random number variable into the script where it says {{JS – Transaction ID}}.

]]>
By: Anonymous https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-21888 Wed, 13 Jan 2021 16:18:39 +0000 http://mixedanalytics.com/?p=7257#comment-21888 In reply to Ana.

Thanks Ana! Sorry, last question. How do I reference a built-in variable like Random Number in a custom js variable?

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-21882 Wed, 13 Jan 2021 05:40:47 +0000 http://mixedanalytics.com/?p=7257#comment-21882 In reply to Sam.

In that case I'd suggest using the random number GTM variable. Plug that in as transaction ID, since at least then you'll see each transaction differentiated on a separate line, even if the ID itself is meaningless to your business.

]]>
By: Sam https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-21879 Tue, 12 Jan 2021 18:51:41 +0000 http://mixedanalytics.com/?p=7257#comment-21879 Thanks for the article! Before jumping in, can this be accomplished if there isn't a transaction ID associated with a purchase (in or case a booking)?

]]>
By: Anonymous https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-16520 Fri, 08 May 2020 09:52:02 +0000 http://mixedanalytics.com/?p=7257#comment-16520 In reply to Ana.

Great, thanks for the quick reply. I highly appreciate that. Have good weekend and stay safe 🙂

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-14945 Wed, 25 Mar 2020 01:15:16 +0000 http://mixedanalytics.com/?p=7257#comment-14945 In reply to Nas.

Thanks for the comment, glad it's useful. And yes, you're exactly right -- this method becomes a lot more reliable if you add in specific IDs. A clear ID like gtm-revenue would work. Though I personally like to use data attributes, since those are specifically intended for containing data rather than changing the layout/design of the site. I wrote one article about tracking with data attributes here.

]]>
By: Nas https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-14930 Tue, 24 Mar 2020 12:55:52 +0000 http://mixedanalytics.com/?p=7257#comment-14930 Such an awesome article!

Thank you so much, I've been looking for an alternative way to implement Ecommerce Tracking via GTM.

This was super useful. Could I ask you a question?

Would this be a more secure or robust method if I were to insert specific CSS ID's to each of the DOM Elements I want to scrape? Then it wouldn't matter if the layout changed slightly overtime as long as these IDs still exist is that correct?

Thanks for your answer!

]]>
By: Anonymous https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-14434 Sun, 08 Mar 2020 00:33:03 +0000 http://mixedanalytics.com/?p=7257#comment-14434 In reply to Ana.

i have sent it over an email, i didn't add it here since i'm just asking for help at something personel ^^'

]]>
By: Ana https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-14420 Sat, 07 Mar 2020 16:00:38 +0000 http://mixedanalytics.com/?p=7257#comment-14420 In reply to Anonymous.

Hey there, if you have a question just add it in right here or send over an email to [email protected].

]]>
By: Anonymous https://mixedanalytics.com/blog/dom-scraping-together-datalayer-for-google-analytics-ecommerce-tracking/#comment-14418 Sat, 07 Mar 2020 15:24:06 +0000 http://mixedanalytics.com/?p=7257#comment-14418 hello,
i have sent you a message on facebook page,
if you can help me at something,
it would be amazing !
thank you

]]>