CMS Development

Jf2
Membre

Scrapping website content to inject in email workflow

Résolue

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 Votes
1 Solution acceptée
Kevin-C
Solution
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Scrapping website content to inject in email workflow

Résolue

@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

Voir la solution dans l'envoi d'origine

0 Votes
2 Réponses
Kevin-C
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Scrapping website content to inject in email workflow

Résolue

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 Votes
Kevin-C
Solution
Expert reconnu | Partenaire solutions
Expert reconnu | Partenaire solutions

Scrapping website content to inject in email workflow

Résolue

@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 Votes