Solved

How can I duplicate my events & URLs into production

  • 26 September 2023
  • 6 replies
  • 51 views

Userlevel 1
Badge +1

Hi there- 

 

I’ve built my Heap events with corresponding URLs in Heap’s Development environment. 

 

Is there an easy way for me to duplicate that environment into Production and change the root URLs? 

 

For example, all of my pageview & event URLs would ideally change from stage.myproduct.com to production.myproduct.com.

 

Additionally, would the CSS selectors be the same or would I need to re-define all of my events

 

Best, 

 

Travis 

icon

Best answer by Christy H 29 September 2023, 17:15

View original

6 replies

Userlevel 4
Badge +3

Hey @travispage,
 
All definitions, properties, reports, segments, dashboards, etc., are shared by default between environments in Heap. Unfortunately, there is no easy way to bulk update pageview definitions, so you’ll want to edit or create new pageview definitions for the relevant pages on your site. If you’ve used filters on your event definitions that utilize domain or path properties, you’ll also want to update those. However, the actual CSS selectors for your event should not need to be updated.
 
 In the future, the best practice would be to add the domain filter to the analysis you are performing rather than to the event definition itself. This will allow you to ensure that an event is set up accurately without making you update it every time you push something to production.
 
 I hope this helps, but please don’t hesitate to reply if you need additional clarity.

Userlevel 1
Badge +1

Thanks for the info @Christy H !

Does this mean that if I change the URL in my production environment in prep for launch it will also change the URLs in my stage environment?

Userlevel 4
Badge +3

@travispage This does mean that any changes you make to events in production will also be made in staging. Typically, the staging and production environments use different subdomains though (which may be your case as well based on the example you gave in your first post).

So you might be able to simply define your pageview events with the path and remove any domain filter that they have in the definition. B/c you’ve pointed data to 2 different environments, this will ensure that you only see staging data in your staging environment and production data in your production environment and you don’t need to specify which domain the data is on in order to have accurate data.

Does this make sense? It’s a bit difficult to explain without concrete examples on your site/in your app.

Userlevel 1
Badge +1

Ahhh right right that makes sense. I think there may be a way here:

My staging env. is stage.cinebody.com and my prod env. is pro.cinebody.com. I could likely define the URL path with broad match? Ex: Https://*.cinebody.com/{whateverpagehere} ?

Userlevel 4
Badge +3

@travispage When defining a pageview event in Heap we actually only need the path (the part of the url that comes after the domain). So if you look at the event definition below for Heap’s pricing page https://www.heap.io/pricing you’ll see that we only included /pricing to define the event. 

 


But your idea of broad matching using the wildcard works too when you want to define a group of pages. In the definition below, this event definition is capturing views on any blog page and not a particular blog post.

 

 

Userlevel 1
Badge +1

Awesome- this is a way simpler solution than I initially thought. 

 

Thanks for everything!

Reply