How to calculate causal effects with repeated exogenous shocks over a time series A rather frequent problem in causal inference is that we come across various shocks over time and try to measure their impact.
In the case of a single shock we can use bayesian methods to predict how much would be the "continuation" of the series without this exogenous shock and to attribute the displacement of the series to the shock.
Example from CausalImpact package (python/R):

In many cases we have several small shocks which makes this simpler approach difficult.
Example (blue line represent an event over time and red bars exogenous shocks):
What would be the correct approach to this problem?

 A: The situation that you describe sound like simple treatment effect story, where the exogenous binary shock represent the treatment. If you have the shock $T=1$, otherwise $T=0$. The blue line represent the level of $x$, your outcome variable. In time series sense $x$ seems stationary, so it come back to the long run mean, then the effect of the shocks is not permanent.
So you can simply compute the difference in the conditional means
$E[x|T=1]-E[x|T=0]$
and it represent the average causal effect (ACE) of the treatment/shock
Note that you assume exogeneity of the shocks (treatments), like in idealized experiment situations, therefore selection bias disappear. Probably you refers on observational situations and among them the endogeneity by confounding variables represent the main problem.
Causal effect in stationary time series can be more exhaustively treated with autoregressive distributed lag models (see for example Econometrics - Verbeek 2017 chap 9.1)
A: Basically you need a good model for the process without shocks, and a good model for a) the effect of the shock on the process, and probably b) the dependence of the effect of the shock on the process. Any answer will be contingent on these. As far as I can see, the 'difference in conditional means' approach discussed by markowitz relies on the assumptions that a) the process characteristics are unchanged by the shock, b) the effect of the shock is realised approximately instantly, and dissipates approximately instantly, and c) the effect of the shock is independent of the state of the system / previous shocks. These may be workable assumptions, but in many cases not. I've a little bit of work discussing ways to think about the modelling of shocks here: https://www.researchgate.net/profile/Charles_Driver/publication/323457904_Understanding_the_time_course_of_interventions_with_continuous_time_dynamic_models/links/5bdef77b299bf1124fba5c00/Understanding-the-time-course-of-interventions-with-continuous-time-dynamic-models.pdf
though that only scratches the surface -- you could take a look at the modelling of hemodynamic response functions in FMRI research for further inspiration.
A: The problem you describe in your question is discussed in detail in the following paper:
Bojinov, Iavor, and Neil Shephard. "Time series experiments and causal estimands: exact randomization tests and trading." Journal of the American Statistical Association 114, no. 528 (2019): 1665-1682.
It would not be very useful to summarize the paper here, because of the significant amount of setup that would be required; besides, you state that you are looking for a "canonical answer."
