def get_transaction_data(consumer_id, transactions):
    """
        For all transactions related to a consumer, return 
        a dictionary with the keys being the offer IDs or the
        value 'transaction' for non-offer related events.
    """

    txn_dict = {}

    txn = transactions[transactions["person"] == consumer_id]
    for obj in txn["transcript_objects"]:
        if "offer id" in obj["value"].keys():
            offer_id = obj["value"]["offer id"]
        elif "offer_id" in obj["value"].keys():
            offer_id = obj["value"]["offer_id"]
        else:
            offer_id = "transaction"
        
        if offer_id not in txn_dict.keys():
            txn_dict[offer_id] = [obj]
        else:
            txn_dict[offer_id] += [obj]
    
    return txn_dict