G’day Hubspot developers forum.
The basic process is:
- fetch a Hubspot page from our server-side app
- parse the result via an HTML parser and pull out the tags and CSS links as necessary
- inject your analytics snippet into the page
- to reduce network use and improve UX, we cache the results of each fetch for an hour
Does this actually sound sane or is this a terrible idea? It is working at the moment, for some definition of “working”. Is there anything more we should be doing? For instance, we don’t pass IP address or cookies to Hubspot when we do our server-side fetch, but we could do that if it would improve the process. I’m hoping that using the Hubspot analytics snippet will provide that capability so that we don’t have to. We also pass along the path and query parameters of the request from our end untouched to Hubspot, so if someone accesses http://our-app/some/path?foo=bar, we connect to http://our-hubspot-cms/some/path?foo=bar accordingly.
Does any of this sound sane or is this a bad idea? I’d be appreciative of any help or advice you can provide.