When you convert a Lead, Salesforce creates a Contact and relates it automatically to the Opportunity, so your Campaign Tracker data is automatically connected to that Opportunity.
But what about when sales creates an Opportunity manually, or converts a different lead that wasn't attributed to your campaign?
If an Opportunity is created separate from the conversion process, it is still possible to re-associate the Contact's first touch or last touch to the Campaign based on your specifications.
Many marketers choose to manually update the "Primary Campaign Source" field on the Opportunity, and/or a custom field, for this purpose.
For higher volume organizations, it may be possible to automate this using the Salesforce Process Builder, depending on lead source and campaign membership data.