Wednesday, May 26, 2021

Get the Table data in Variable with the help of Google Tag Manager

The solution which I have shared here can be done through the enhanced ecommerce process, but I have requirements to get it into variables list.  




Script to run: 

Output: Seat in Security Incident Response with course completion certificate

function(){

return document.querySelector('tr:nth-child(1) td').innerText;

}

Output: Silver 

function(){

return document.querySelector('tr:nth-child(2) td').innerText;

}

Output: SKILLUP-191478


function(){

return document.querySelector('.buying-right p').innerText;

}


Copyright 2020 - All Rights Reserved