One of President Donald Trump's trade war goals is to shrink the US goods trade deficit.

Despite the implementation of tariffs, the goods deficit grew in July, according to preliminary data from the US Census Bureau.

Exports declined in July compared to the month before, while imports climbed slightly.

One of President Donald Trump's main goals in his shake-up of US trade policy: Bring down the large US trade deficit. But that deficit appears to be heading in the opposite direction since the trade war kicked off in earnest.

The US goods trade deficit increased to $72.2 billion in July, up from $67.9 billion in June, according to advance data from the US Census Bureau. Exports fell by 1.7% from the month before, while imports rose by 0.9%. This was the second straight month the trade deficit has increased.

Trump has repeatedly pointed to the large US goods trade deficit with countries like China and Mexico as reason to impose tariffs. Tariffs on Chinese goods, as well retaliatory tariffs against the US from Canada, Mexico, and the European Union, went into effect in July.

The monthly growth also means the year-to-date trade deficit is 7% larger than the same period in 2017.

The trade deficit actually narrowed in the second quarter of 2018, which economists said was in part because exporters were attempting to move their product ahead of the tariffs. Daniel Silver, an economist at JPMorgan, said the latest data appears to show the export growth trend is moving quickly in the opposite direction.

"We have been expecting net exports to be a significant drag on third quarter growth as the second quarter surge in exports unwinds, and this appears to be playing out more rapidly (and more meaningfully) than we had anticipated," Silver wrote in a note to clients.

The data is only a preliminary accounting, with more robust data coming next week. And the month-to-month movements of the trade deficit can get noisy particularly given the big changes in recent policy.

But as Trump continues to reshape the global trade landscape, the deficit can give a real-time look at how it is playing out in real time.

The data may also contain some more positive news for the president's larger economic goals. The increase in inventories and strong import growth indicate resilient demand from US consumers that could signal a strong third-quarter GDP reading.