Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- if (document.location.pathname.indexOf('/heb/pages/default.aspx') > -1) {
- var target = document.getElementById('MsgThanks');
- var observer = new MutationObserver(function(mutations) {
- mutations.forEach(function(mutation) {
- var chkstring = 'style=\"\"';
- if (mutation.target.outerHTML.indexOf(chkstring) > -1) {
- dataLayer.push({
- 'event': 'form-submit'
- });
- }
- console.log(mutation.target.outerHTML);
- });
- });
- observer.observe(target, {
- attributes: true,
- attributeFilter: ['style']
- });
- }
- else if(document.location.hostname.indexOf('knowledge') > -1) {
- var target = document.querySelector('div.bottom-container');
- var observer = new MutationObserver(function(mutations) {
- mutations.forEach(function(mutation) {
- if (mutation.target.outerHTML.indexOf('thankYou') > -1){
- dataLayer.push({
- 'event': 'form-submit'
- });
- }
- console.log(mutation.target);
- });
- });
- var config = {
- attributes: true
- };
- observer.observe(target, config);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement