CMS Development

Jf2
メンバー

Scrapping website content to inject in email workflow

解決

Hi all,

 

Looking to set up the following process (need help with step 3):

  1. User comes to client site and creates a quote
  2. User displays exit intent, HubSpot pop up drives user to receive quote by email
  3. HubSpot to scrape the quote table from the page they are on and inject content into an email via the use of workflows/tokens or any proposed process

Thanks for all thoughts in advance.

0 いいね!
1件の承認済みベストアンサー
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Scrapping website content to inject in email workflow

解決

@Jf2 

 

Following up on my comment:

 

Checkout @alyssamwilie 's answer to this post. This is the technique you'd want to use to get the info.

 

Write a function similar to the code below to get the data and add it to the window object:

 

$(document).ready(function() {
      // Declare your table data variable
      var tableData = [];

      $('#target tr').each(function(index) {
        // Add empty array to the tableData variable
        tableData.push([]);

        // Loop through trs and push values to the array at index
        $(this).find('td').each(function(j, el) {
          tableData[index].push(el.textContent);
        });
      });

      // Add the tableDato the window object for easy access
      window.tableData = tableData;
    });

 

You'll get a data structure like so:

Screeenshot - 2020-08-05 at 4.38.15 PM.png

 

Then write a function that populates the hidden fields in the popup. Somthing like this maybe:

$('#hidden-field-id').val(window.tableData[1][2]);

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

元の投稿で解決策を見る

0 いいね!
2件の返信
Kevin-C
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Scrapping website content to inject in email workflow

解決

Hey @Jf2 

 

So this could be rather simple:

 

On page load capture the table data and store it on the window.

On "exit intent", popup a form with hiden field.

Populate the forms hidden field with the data from the window variable.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 いいね!
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Scrapping website content to inject in email workflow

解決

@Jf2 

 

Following up on my comment:

 

Checkout @alyssamwilie 's answer to this post. This is the technique you'd want to use to get the info.

 

Write a function similar to the code below to get the data and add it to the window object:

 

$(document).ready(function() {
      // Declare your table data variable
      var tableData = [];

      $('#target tr').each(function(index) {
        // Add empty array to the tableData variable
        tableData.push([]);

        // Loop through trs and push values to the array at index
        $(this).find('td').each(function(j, el) {
          tableData[index].push(el.textContent);
        });
      });

      // Add the tableDato the window object for easy access
      window.tableData = tableData;
    });

 

You'll get a data structure like so:

Screeenshot - 2020-08-05 at 4.38.15 PM.png

 

Then write a function that populates the hidden fields in the popup. Somthing like this maybe:

$('#hidden-field-id').val(window.tableData[1][2]);

 

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 いいね!