Hubspot integration help

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 14, 2016   (RSS)

By mizrahi - January 12, 2016

I am working with a client on a site that will be receiving some traffic via Hubspot tracking codes. The tracking codes are causing my pages to error out. For example

Original page URL:
https://www.sitename.com/section/?Page-Name-2 

Hubspot tracking URL:
https://www.sitename.com/section/?Page-Name-2&utm_campaign=Current+Leads+Opt+In&utm_source=hs_email&utm_medium=email&utm_content=25098955&_hsenc=p2ANqtz--x0HlCWUyJGvnqJIYQ0H1lkEGrawkvf_UIXTe6z8URyioHeRYEqGb-yYRT6S-oO83JL7y_kRt8ByEl7oIIuwKlw4KBBA&_hsmi=25099732

The Hubspot URLs are causing the pages to error out due to the CMS portion not being at the end of the URL. Any thoughts on how to resolve this? 

By Damon - January 12, 2016

Hi, 

In CMS Builder we added code to remove 3rd party field-value pairs from query string as they might contain trailing numbers.

This post by Dave shows some of the fields that are removed:
https://www.interactivetools.com/forum/forum-posts.php?postNum=2229724#post2229724 

You can add to the list the additional fields to filter:

'_hsenc','_hsmi',

Let me know if you have any questions about this and if it solves the error.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By mizrahi - January 13, 2016

I added those to the viewer_functions (see below), but the pages are still not loading. But if I remove those two new parameters from the URL, the page does load. 

    $removeFields  = array(
      'utm_source','utm_medium','utm_term','utm_content','utm_campaign',          // google utm names: http://www.google.com/support/googleanalytics/bin/answer.py?answer=55578
      'fb_source','fb_action_ids','fb_action_types','fb_ref','fb_aggregation_id', // facebook parameter names: https://developers.facebook.com/docs/technical-guides/opengraph/link-parameters/
      'action_object_map','action_type_map','action_ref_map',                     // additional facebook parameters
      '_hsenc','_hsmi',                     // additional hubspot parameters
    );
    foreach ($removeFields as $removeField) { $urlData = preg_replace("/&$removeField=[^&]*/", '', $urlData); }

By mizrahi - January 13, 2016

Hold tight. I think there is a cache issue.