Here is the general story (as in section 4.3 of *Principal infinity-bundles -- General theory*).

So consider

$$
A \stackrel{i}{\to} \hat G \stackrel{p}{\to} G
$$

a "central" extension of higher groups, hence a long homotopy fiber sequence of the form

$$
\array{
\mathbf{B}A &\stackrel{}{\to}& \mathbf{B}\hat G
\\
&& \downarrow
\\
&& \mathbf{B}G &\stackrel{\mathbf{c}}{\to}& \mathbf{B}^2 A
}
\,,
$$

where the map $\mathbf{c}$ is the cocycle that classifies the extension. For instance if $A = \mathbf{B} ker(t)$ then this is a higher group 3-cocycle on $G$ with coefficients in $ker(t)$.

Now by the pasting law for homotopy pullbacks, if you have a $\hat G$-principal infinity-bundle modulated by a map

$$
X \stackrel{\hat g}{\to} \mathbf{B}\hat G
$$

with, hence, underlying $G$-principal $\infty$-bundle modulated by

$$
g : X \stackrel{\hat g}{\to} \mathbf{B}\hat G \stackrel{}{\to} \mathbf{B}G
$$

(this may be an ordinary principal bundle if $G$ is a 0-truncated $\infty$-group, as in your case)

then we get the pasting diagram of homotopy pullbacks of the form

$$
\array{
\hat G &\to& \hat P &\to& \ast
\\
\downarrow && \downarrow && \downarrow
\\
G &\to& P &\to& \mathbf{B}A &\to& \ast
\\
\downarrow && \downarrow && \downarrow && \downarrow
\\
\ast &\stackrel{x}{\to}& X &\stackrel{\hat g}{\to}& \mathbf{B}\hat G &\stackrel{}{\to}& \mathbf{B}G
}
\,.
$$

Here we read off

$\hat P \to X$ is the $\hat G$-principal $\infty$-bundle modulated by $\hat g$

$P \to X$ is the underlying $G$-principal $\infty$-bundle;

$\hat P \to P$ is an $A$-principal $\infty$-bundle on the total space of $P$ with the special property that restricted to the fibers it becomes the extension $\hat G \to G$ that we started with

This is the stage-wise decomposition of principal $\infty$-bundles which is induced from the extension of $\infty$-groups that we started with. This construction establishes an equivalence of $\infty$-categories between $\hat G$-principal $\infty$-bundles on $X$ and $A$-principal $\infty$-bundles on total spaces of $G$-principal $\infty$-bundles satisfying these compatibility conditions.

An important example of this is the case where $\hat G$ is the smooth string 2-group sitting in the extension

$$
\mathbf{B} U(1) \to String \to Spin
\,.
$$

and classfied by the smooth refinement of the first fractional Pontryagin class $\frac{1}{2}\mathbf{p}_1$. Here the above tells us that String-2 bundles are equivalently circle 2-bundles on total spaces of Spin-principal bundles which restrict to the canonical bundle gerbe on each fiber.

(I could say more, but I need to stop as the updating of the formula typesetting almost kills my little computer now. This used to be better with the previous MO version, where I could select "one shot math preview"...)